]> granicus.if.org Git - python/commitdiff
use file() in preference to open()
authorSkip Montanaro <skip@pobox.com>
Wed, 30 Jun 2004 21:06:45 +0000 (21:06 +0000)
committerSkip Montanaro <skip@pobox.com>
Wed, 30 Jun 2004 21:06:45 +0000 (21:06 +0000)
Doc/lib/libfcntl.tex

index 21daa419d46bec5e11982739efa6ced9466340f0..f7d4438c03b20ee82abb1b3c41a9739e03f85778 100644 (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