磨刀不误砍柴工
system administration is a craft
Sunday, March 29, 2009
file lock on python code
#import the package:
import fcntl
#lock file handle:
fcntl.lockf(logFile.fileno(), fcntl.LOCK_EX|fcntl.LOCK_NB)
#unlock file handle
fcntl.lockf(logFile.fileno(), fcntl.LOCK_UN)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.