[New-bugs-announce] [issue3517] PATCH - Providing fullfsync on supported platforms

Ian Charnas report at bugs.python.org
Thu Aug 7 19:31:59 CEST 2008

New submission from Ian Charnas <ian.charnas at gmail.com>:

Python currently provides os.fsync to call the POSIX 'fsync' on
platforms that support it.  While this function forces the operating
system to force a file buffer to the storage device, data may still be
waiting in the hardware write buffers on the storage device.  Certain
platforms (so far, only OS X) provide "fullfsync" [1] to request that
storage devices flush their write buffers to the actual physical media.  

This functionality is especially useful to VCS and DB developers, and
already appears in SQLite [2] and MySQL [3], amongst others.

This patch includes code changes to Modules/posixmodule.c that exposes
os.fullfsync on supported platforms, including the appropriate
documentation added to Doc/library/os.rst

-Ian Charnas

[1] Discussion of fsync and fullfsync on darwin platform:

[2] SQLite uses fullfsync on all platforms that define it:

[3] MySQL uses fullfsync only on the darwin platform and only when
F_FULLFSYNC is defined as 51, which seems to be short-sighted in that
this symbol may change value in future versions of OS X.  To see this
code, download a mysql 5.x source snapshot and open up

components: Library (Lib)
files: fullfsync.patch
keywords: patch
messages: 70842
nosy: icharnas
severity: normal
status: open
title: PATCH - Providing fullfsync on supported platforms
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file11072/fullfsync.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list