]> granicus.if.org Git - python/commitdiff
Merged revisions 81594 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 29 May 2010 12:08:31 +0000 (12:08 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 29 May 2010 12:08:31 +0000 (12:08 +0000)
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
........

Doc/library/io.rst

index 1a4b959ebf4b01a51d79ccd8a56d45f3bfcfb23e..e3f8b36a09e6e25a970f3d1df0533241c54cf896 100644 (file)
@@ -294,10 +294,12 @@ I/O Base Classes
 
    .. method:: truncate([size])
 
-      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()