Commit 9fe6199b authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #8840: Make documentation for truncate() clearer

parent 84a8d8fb
...@@ -320,10 +320,12 @@ I/O Base Classes ...@@ -320,10 +320,12 @@ I/O Base Classes
.. method:: truncate(size=None) .. method:: truncate(size=None)
Truncate the file to at most *size* bytes. *size* defaults to the current Resize the stream to the given *size* in bytes (or the current position
file position, as returned by :meth:`tell`. Note that the current file if *size* is not specified). The current stream position isn't changed.
position isn't changed; if you want to change it to the new end of This resizing can extend or reduce the current file size. In case of
file, you have to :meth:`seek()` explicitly. 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() .. method:: writable()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment