This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: mailbox: use fsync() to ensure data is really on disk
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, baikie
Priority: normal Keywords: patch

Created on 2006-06-29 18:27 by baikie, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mailbox-fsync.diff baikie, 2006-06-29 18:27 Use fsync() to ensure data is really on disk
Messages (4)
msg50558 - (view) Author: David Watson (baikie) Date: 2006-06-29 18:27
The mailbox module currently does nothing to ensure
messages/indexes are physically on disk when the
flush() method returns or message files are closed. 
This patch adds functions _sync_flush and _sync_close
to flush and fsync() a file object, and in the latter
case close it afterwards.  _sync_close is then used
where needed throughout the code.  (For various reasons
the current implementation only ever requires a sync
immediately before closing a file, but _sync_flush is
provided for future use.)
msg50559 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-11-09 13:55
Logged In: YES 
user_id=11375

I've tweaked the top comment in the patch a little and
applied it to the trunk in rev. 52692 (so it'll be in 2.6).

Because it's an internal API change, I'm cautious about
applying it to the 25-maint branch, but will raise the issue
on python-dev.
msg50560 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-11-09 13:56
Logged In: YES 
user_id=11375

Oops!  I forgot to say: thank you for the patch!
msg50561 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-11-10 13:08
Logged In: YES 
user_id=11375

Committed to the 25-maint branch in rev. 52718.  
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43577
2006-06-29 18:27:16baikiecreate