diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-29 12:06:13 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-29 12:06:13 (GMT) |
commit | 9fe6199b4e898b3ad0d93690b64a59c7838567b0 (patch) | |
tree | e3092acf6eb1be83f820be81909933498004490a /Doc/library/io.rst | |
parent | 84a8d8fbf29663474955a7fddc6391396e9bd1d9 (diff) | |
download | cpython-9fe6199b4e898b3ad0d93690b64a59c7838567b0.zip cpython-9fe6199b4e898b3ad0d93690b64a59c7838567b0.tar.gz cpython-9fe6199b4e898b3ad0d93690b64a59c7838567b0.tar.bz2 |
Issue #8840: Make documentation for truncate() clearer
Diffstat (limited to 'Doc/library/io.rst')
-rw-r--r-- | Doc/library/io.rst | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 63895bc..c755a2b 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -320,10 +320,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() |