From 1312b4bcfdb85577b317f0024efe271aee18856b Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 12 Feb 2009 03:50:00 +0000 Subject: [PATCH] os.fsync() should be used to ensure that data is written to disk --- Doc/library/stdtypes.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index b383a40829c..09ba2538fa1 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2110,6 +2110,11 @@ Files have the following methods: Flush the internal buffer, like ``stdio``'s :cfunc:`fflush`. This may be a no-op on some file-like objects. + .. note:: + + :meth:`flush` does not necessarily write the file's data to disk. Use + :meth:`flush` followed by :func:`os.fsync` to ensure this behavior. + .. method:: file.fileno()