This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: fcntl example is broken
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: chrisgreen, nnorwitz
Priority: normal Keywords:

Created on 2004-07-20 15:54 by chrisgreen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg21723 - (view) Author: Chris Green (chrisgreen) Date: 2004-07-20 15:54
http://www.python.org/doc/current/lib/module-fcntl.html
import os,struct, fcntl
f = open(".zshrc", "r+")
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)

It was missing an os import and was directly calling
the module 
msg21724 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2004-07-21 01:41
Logged In: YES 
user_id=33168

Thanks.  Fixed in Doc/lib/libfcntl.tex 1.36
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40606
2004-07-20 15:54:51chrisgreencreate