]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF #994605, fcntl example is broken
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 21 Jul 2004 01:41:14 +0000 (01:41 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 21 Jul 2004 01:41:14 +0000 (01:41 +0000)
The last call to fcntl (which wasn't changed) doesn't work for me, but
the first part works now.

Backport candidate.

Doc/lib/libfcntl.tex

index f7d4438c03b20ee82abb1b3c41a9739e03f85778..df258ee0bcd847f1627ca84c53bc5985b5af15ef 100644 (file)
@@ -151,10 +151,10 @@ to lock to the end of the file.  The default for \var{whence} is also
 Examples (all on a SVR4 compliant system):
 
 \begin{verbatim}
-import struct, fcntl
+import struct, fcntl, os
 
-f = file(...)
-rv = fcntl(f, fcntl.F_SETFL, os.O_NDELAY)
+f = open(...)
+rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)
 
 lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)
 rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)