use file() in preference to open()
This commit is contained in:
parent
7db865af40
commit
2ccf5d689b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue