Petri Lehtinen <pe...@digip.org> added the comment:

This is actually not true. When calling add(), mbox (and MMDF and Babyl) append 
the message to the file without rewriting it.

It's the following flush() call that rewrites the whole mailbox contents. I 
think this could be changed to work correctly by not setting self._pending = 
True in _singlefileMailbox.add. This way, the file wouldn't be rewritten by 
flush() if messages are only appended.

OTOH, flush() should still fsync the mailbox file (if we want to ensure that 
the changes are really written to disk). This would probably require a new flag 
in addition to self._pending, to indicate that there are unsynced changes.

----------
nosy: +petri.lehtinen

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9559>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to