]> granicus.if.org Git - python/commitdiff
Removed some spurios biindex calls.
authorGuido van Rossum <guido@python.org>
Thu, 2 May 1996 15:28:53 +0000 (15:28 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 2 May 1996 15:28:53 +0000 (15:28 +0000)
Added description of file.truncate().
Added warning to write() about buffering.

Doc/lib/libtypes.tex
Doc/libtypes.tex

index 5c6bce8994c4c9a4adc0f731c3fd8684a85c25e4..052bc9fe567bdf4654d64114b3bf069adedbdb71 100644 (file)
@@ -639,9 +639,6 @@ built-in functions and methods, e.g.\ \code{posix.popen()} and
 \code{posix.fdopen()} and the \code{makefile()} method of socket
 objects.
 \bifuncindex{open}
-\bifuncindex{popen}
-\bifuncindex{fdopen}
-\bifuncindex{makefile}
 
 When a file operation fails for an I/O-related reason, the exception
 \code{IOError} is raised.  This includes situations where the
@@ -712,8 +709,18 @@ Files have the following methods:
   Return the file's current position, like \code{stdio}'s \code{ftell()}.
 \end{funcdesc}
 
+\begin{funcdesc}{truncate}{\optional{size}}
+Truncate the file's size.  If the optional size argument present, the
+file is truncated to (at most) that size.  The size defaults to the
+current position.  Availability of this function depends on the
+operating system version (e.g., not all {\UNIX} versions support this
+operation).
+\end{funcdesc}
+
 \begin{funcdesc}{write}{str}
-  Write a string to the file.  There is no return value.
+Write a string to the file.  There is no return value.  Note: due to
+buffering, the string may not actually show up in the file until
+the \code{flush()} or \code{close()} method is called.
 \end{funcdesc}
 
 \begin{funcdesc}{writelines}{list}
index 5c6bce8994c4c9a4adc0f731c3fd8684a85c25e4..052bc9fe567bdf4654d64114b3bf069adedbdb71 100644 (file)
@@ -639,9 +639,6 @@ built-in functions and methods, e.g.\ \code{posix.popen()} and
 \code{posix.fdopen()} and the \code{makefile()} method of socket
 objects.
 \bifuncindex{open}
-\bifuncindex{popen}
-\bifuncindex{fdopen}
-\bifuncindex{makefile}
 
 When a file operation fails for an I/O-related reason, the exception
 \code{IOError} is raised.  This includes situations where the
@@ -712,8 +709,18 @@ Files have the following methods:
   Return the file's current position, like \code{stdio}'s \code{ftell()}.
 \end{funcdesc}
 
+\begin{funcdesc}{truncate}{\optional{size}}
+Truncate the file's size.  If the optional size argument present, the
+file is truncated to (at most) that size.  The size defaults to the
+current position.  Availability of this function depends on the
+operating system version (e.g., not all {\UNIX} versions support this
+operation).
+\end{funcdesc}
+
 \begin{funcdesc}{write}{str}
-  Write a string to the file.  There is no return value.
+Write a string to the file.  There is no return value.  Note: due to
+buffering, the string may not actually show up in the file until
+the \code{flush()} or \code{close()} method is called.
 \end{funcdesc}
 
 \begin{funcdesc}{writelines}{list}