##// END OF EJS Templates
vfs: make atomictempfile avoid ambiguity of file stat if needed...
FUJIWARA Katsunori -
r29202:76f1ea36 default
parent child Browse files
Show More
@@ -502,7 +502,7 b' class vfs(abstractvfs):'
502 os.chmod(name, self.createmode & 0o666)
502 os.chmod(name, self.createmode & 0o666)
503
503
504 def __call__(self, path, mode="r", text=False, atomictemp=False,
504 def __call__(self, path, mode="r", text=False, atomictemp=False,
505 notindexed=False, backgroundclose=False):
505 notindexed=False, backgroundclose=False, checkambig=False):
506 '''Open ``path`` file, which is relative to vfs root.
506 '''Open ``path`` file, which is relative to vfs root.
507
507
508 Newly created directories are marked as "not to be indexed by
508 Newly created directories are marked as "not to be indexed by
@@ -521,6 +521,8 b' class vfs(abstractvfs):'
521 closing a file on a background thread and reopening it. (If the
521 closing a file on a background thread and reopening it. (If the
522 file were opened multiple times, there could be unflushed data
522 file were opened multiple times, there could be unflushed data
523 because the original file handle hasn't been flushed/closed yet.)
523 because the original file handle hasn't been flushed/closed yet.)
524
525 ``checkambig`` is passed to atomictempfile (valid only for writing).
524 '''
526 '''
525 if self._audit:
527 if self._audit:
526 r = util.checkosfilename(path)
528 r = util.checkosfilename(path)
@@ -540,7 +542,8 b' class vfs(abstractvfs):'
540 if basename:
542 if basename:
541 if atomictemp:
543 if atomictemp:
542 util.makedirs(dirname, self.createmode, notindexed)
544 util.makedirs(dirname, self.createmode, notindexed)
543 return util.atomictempfile(f, mode, self.createmode)
545 return util.atomictempfile(f, mode, self.createmode,
546 checkambig=checkambig)
544 try:
547 try:
545 if 'w' in mode:
548 if 'w' in mode:
546 util.unlink(f)
549 util.unlink(f)
General Comments 0
You need to be logged in to leave comments. Login now