[issue12102] mmap requires file to be synced
Steffen Daode Nurpmeso
report at bugs.python.org
Wed May 18 14:31:01 CEST 2011
Steffen Daode Nurpmeso <sdaoden at googlemail.com> added the comment:
@ rion wrote (2011-05-18 12:39+0200):
> just document it or fix.
Hello, zion, Victor, i'm proposing a documentation patch.
It applies to 2.7 and 3.3 (from yesterday).
----------
keywords: +patch
Added file: http://bugs.python.org/file22020/12102.1.diff
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12102>
_______________________________________
-------------- next part --------------
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -21,6 +21,11 @@
:func:`os.open` function, which returns a file descriptor directly (the file
still needs to be closed when done).
+..note::
+ If you want to create a memory-mapping for a writable, buffered file, you
+ should :func:`flush` the file first. This is necessary to ensure local
+ modifications to the buffers are actually available to the mapping.
+
For both the Unix and Windows versions of the constructor, *access* may be
specified as an optional keyword parameter. *access* accepts one of three
values: :const:`ACCESS_READ`, :const:`ACCESS_WRITE`, or :const:`ACCESS_COPY`
More information about the Python-bugs-list
mailing list