use file() in preference to open()

This commit is contained in:
Skip Montanaro 2004-06-30 21:06:45 +00:00
parent 7db865af40
commit 2ccf5d689b
1 changed files with 3 additions and 3 deletions

View File

@ -153,11 +153,11 @@ Examples (all on a SVR4 compliant system):
\begin{verbatim}
import struct, fcntl
file = open(...)
rv = fcntl(file, fcntl.F_SETFL, os.O_NDELAY)
f = file(...)
rv = fcntl(f, fcntl.F_SETFL, os.O_NDELAY)
lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
rv = fcntl.fcntl(file, fcntl.F_SETLKW, lockdata)
rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)
\end{verbatim}
Note that in the first example the return value variable \var{rv} will