summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libos.tex
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-04-23 02:39:17 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-04-23 02:39:17 (GMT)
commit11b230696081e5c91153229616732a707dc9f94d (patch)
tree01c27dab8709bf147398c842034e4b0a35b8343c /Doc/lib/libos.tex
parent9a9c436036dbd25d6ae42f67f22ccc5549b3c092 (diff)
downloadcpython-11b230696081e5c91153229616732a707dc9f94d.zip
cpython-11b230696081e5c91153229616732a707dc9f94d.tar.gz
cpython-11b230696081e5c91153229616732a707dc9f94d.tar.bz2
Enable os.fsync() for Windows, mapping it to MS's _commit() there. The
docs here are best-guess: the MS docs I could find weren't clear, and some even claimed _commit() has no effect on Win32 systems (which is easily shown to be false just by trying it).
Diffstat (limited to 'Doc/lib/libos.tex')
-rw-r--r--Doc/lib/libos.tex10
1 files changed, 8 insertions, 2 deletions
diff --git a/Doc/lib/libos.tex b/Doc/lib/libos.tex
index 07762c6..8437614 100644
--- a/Doc/lib/libos.tex
+++ b/Doc/lib/libos.tex
@@ -449,7 +449,13 @@ Availability: \UNIX.
\begin{funcdesc}{fsync}{fd}
Force write of file with filedescriptor \var{fd} to disk.
-Availability: \UNIX.
+
+On Windows this calls the MS \cfunction{_commit()} function. If you're
+starting with a Python file object \var{f}, first do
+\code{\var{f}.flush()}, and then do \code{os.fsync(\var{f}.fileno()},
+to ensure that all internal buffers associated with \var{f} are written
+to disk.
+Availability: \UNIX, and Windows starting in 2.3.
\end{funcdesc}
\begin{funcdesc}{ftruncate}{fd, length}
@@ -921,7 +927,7 @@ order
\member{st_atime},
\member{st_mtime},
\member{st_ctime}.
-More items may be added at the end by some implementations.
+More items may be added at the end by some implementations.
The standard module \refmodule{stat}\refstmodindex{stat} defines
functions and constants that are useful for extracting information
from a \ctype{stat} structure.