equal
deleted
inserted
replaced
340 |
340 |
341 def _write(self, vfs, entry): |
341 def _write(self, vfs, entry): |
342 with self.jlock(vfs): |
342 with self.jlock(vfs): |
343 version = None |
343 version = None |
344 # open file in amend mode to ensure it is created if missing |
344 # open file in amend mode to ensure it is created if missing |
345 with vfs('namejournal', mode='a+b', atomictemp=True) as f: |
345 with vfs('namejournal', mode='a+b') as f: |
346 f.seek(0, os.SEEK_SET) |
346 f.seek(0, os.SEEK_SET) |
347 # Read just enough bytes to get a version number (up to 2 |
347 # Read just enough bytes to get a version number (up to 2 |
348 # digits plus separator) |
348 # digits plus separator) |
349 version = f.read(3).partition('\0')[0] |
349 version = f.read(3).partition('\0')[0] |
350 if version and version != str(storageversion): |
350 if version and version != str(storageversion): |