254 except IOError as inst: |
254 except IOError as inst: |
255 if inst.errno != errno.ENOENT: |
255 if inst.errno != errno.ENOENT: |
256 raise |
256 raise |
257 return [] |
257 return [] |
258 |
258 |
259 def open(self, path, mode="r", text=False, atomictemp=False, |
259 @util.propertycache |
260 notindexed=False, backgroundclose=False): |
260 def open(self): |
261 '''Open ``path`` file, which is relative to vfs root. |
261 '''Open ``path`` file, which is relative to vfs root. |
262 |
262 |
263 Newly created directories are marked as "not to be indexed by |
263 Newly created directories are marked as "not to be indexed by |
264 the content indexing service", if ``notindexed`` is specified |
264 the content indexing service", if ``notindexed`` is specified |
265 for "write" mode access. |
265 for "write" mode access. |
266 ''' |
266 ''' |
267 self.open = self.__call__ |
267 return self.__call__ |
268 return self.__call__(path, mode, text, atomictemp, notindexed, |
|
269 backgroundclose=backgroundclose) |
|
270 |
268 |
271 def read(self, path): |
269 def read(self, path): |
272 with self(path, 'rb') as fp: |
270 with self(path, 'rb') as fp: |
273 return fp.read() |
271 return fp.read() |
274 |
272 |