summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-05-29 12:10:15 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-05-29 12:10:15 (GMT)
commitea2b0b4992384b299f54e047b986c1b4ba743995 (patch)
treeb63aa0aa00e202b63b6c2b31e3269ffd0277f57c
parentd0b5a50b1d44bed2f6e1dc5d8b3b40de44453b0c (diff)
downloadcpython-ea2b0b4992384b299f54e047b986c1b4ba743995.zip
cpython-ea2b0b4992384b299f54e047b986c1b4ba743995.tar.gz
cpython-ea2b0b4992384b299f54e047b986c1b4ba743995.tar.bz2
Merged revisions 81595 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81595 | antoine.pitrou | 2010-05-29 14:08:25 +0200 (sam., 29 mai 2010) | 9 lines Merged revisions 81594 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81594 | antoine.pitrou | 2010-05-29 14:06:13 +0200 (sam., 29 mai 2010) | 3 lines Issue #8840: Make documentation for truncate() clearer ........ ................
-rw-r--r--Doc/library/io.rst10
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 8bbd6cb..3e98ca9 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -309,10 +309,12 @@ I/O Base Classes
.. method:: truncate(size=None)
- Truncate the file to at most *size* bytes. *size* defaults to the current
- file position, as returned by :meth:`tell`. Note that the current file
- position isn't changed; if you want to change it to the new end of
- file, you have to :meth:`seek()` explicitly.
+ Resize the stream to the given *size* in bytes (or the current position
+ if *size* is not specified). The current stream position isn't changed.
+ This resizing can extend or reduce the current file size. In case of
+ extension, the contents of the new file area depend on the platform
+ (on most systems, additional bytes are zero-filled, on Windows they're
+ undetermined). The new file size is returned.
.. method:: writable()