/head: changeset 50

Fixed save() such that it will be atomic. If the program crashes while
writing, it is guaranteed to have either a complete copy of the old or
the new data.
This commit is contained in:
jgoerzen 2002-06-25 01:58:25 +01:00
parent 05d8f27955
commit 132a38bfce
4 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,22 @@
2002-06-24 09:58 jgoerzen
* debian/changelog, offlineimap/version.py: Preparation for 1.0.2
2002-06-24 09:54 jgoerzen
* offlineimap/folder/LocalStatus.py: Fixed save() such that it will
be atomic. If the program crashes while writing, it is guaranteed
to have either a complete copy of the old or the new data.
2002-06-22 21:37 jgoerzen
* TODO: Added.
2002-06-21 22:04 jgoerzen
* ChangeLog, debian/changelog, offlineimap/version.py: Final prep
for 1.0.1
2002-06-21 22:03 jgoerzen
* offlineimap.py, offlineimap/folder/IMAP.py: Fixed a bug with

View File

@ -1,3 +1,11 @@
offlineimap (1.0.2) unstable; urgency=low
* Made sure that LocalStatus does writing atomically. If the program
is interrupted during save(), there will always be a complete copy of
either the old or the new data.
-- John Goerzen <jgoerzen@complete.org> Mon, 24 Jun 2002 09:57:28 -0500
offlineimap (1.0.1) unstable; urgency=low
* Fixed a bug with writing messages to some IMAP servers. Turns

View File

@ -61,7 +61,7 @@ class LocalStatusFolder(BaseFolder):
file.close()
def save(self):
file = open(self.filename, "wt")
file = open(self.filename + ".tmp", "wt")
file.write(magicline + "\n")
for msg in self.messagelist.values():
flags = msg['flags']
@ -69,6 +69,7 @@ class LocalStatusFolder(BaseFolder):
flags = ''.join(flags)
file.write("%s:%s\n" % (msg['uid'], flags))
file.close()
os.rename(self.filename + ".tmp", self.filename)
def getmessagelist(self):
return self.messagelist

View File

@ -1,5 +1,5 @@
productname = 'OfflineIMAP'
versionstr = "1.0.1"
versionstr = "1.0.2"
versionlist = versionstr.split(".")
major = versionlist[0]