parent
6fd4962b4c
commit
c046383dc2
@ -40,13 +40,11 @@ class LocalStatusRepository(BaseRepository):
|
|||||||
def makefolder(self, foldername):
|
def makefolder(self, foldername):
|
||||||
# "touch" the file, truncating it.
|
# "touch" the file, truncating it.
|
||||||
filename = self.getfolderfilename(foldername)
|
filename = self.getfolderfilename(foldername)
|
||||||
file = open(filename + ".tmp", "wb")
|
file = open(filename + ".tmp", "wt")
|
||||||
file.write(offlineimap.folder.LocalStatus.magicline + '\n')
|
file.write(offlineimap.folder.LocalStatus.magicline + '\n')
|
||||||
|
file.flush()
|
||||||
|
os.fsync(file.fileno())
|
||||||
file.close()
|
file.close()
|
||||||
try:
|
|
||||||
os.unlink(filename)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
os.rename(filename + ".tmp", filename)
|
os.rename(filename + ".tmp", filename)
|
||||||
|
|
||||||
# Invalidate the cache.
|
# Invalidate the cache.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user