Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19ae783

Browse files
committed
Added information about the interaction of opening a file in append mode
and seek() in the description of seek(). This closes SF bug #126850.
1 parent 22e9a5e commit 19ae783

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Doc/lib/libstdtypes.tex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,12 @@ \subsubsection{File Objects\obindex{file}
10791079
The \var{whence} argument is optional and defaults to \code{0}
10801080
(absolute file positioning); other values are \code{1} (seek
10811081
relative to the current position) and \code{2} (seek relative to the
1082-
file's end). There is no return value.
1082+
file's end). There is no return value. Note that if the file is
1083+
opened for appending (mode \code{'a'} or \code{'a+'}), any
1084+
\method{seek()} operations will be undone at the next write. If the
1085+
file is only opened for writing in append mode (mode \code{'a'}),
1086+
this method is essentially a no-op, but it remains useful for files
1087+
opened in append mode with reading enabled (mode \code{'a+'}).
10831088
\end{methoddesc}
10841089

10851090
\begin{methoddesc}[file]{tell}{}

0 commit comments

Comments
 (0)