From: Skip Montanaro Date: Wed, 30 Jun 2004 21:06:45 +0000 (+0000) Subject: use file() in preference to open() X-Git-Tag: v2.4a1~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ccf5d689bc1b893fc89ba3f5131a5f504dff1cd;p=python use file() in preference to open() --- diff --git a/Doc/lib/libfcntl.tex b/Doc/lib/libfcntl.tex index 21daa419d4..f7d4438c03 100644 --- a/Doc/lib/libfcntl.tex +++ b/Doc/lib/libfcntl.tex @@ -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