| Trees | Indices | Help |
|---|
|
|
Locked file interface that should work on Unix and Windows pythons.
This module first tries to use fcntl locking to ensure serialized access
to a file, then falls back on a lock file if that is unavialable.
Usage:
f = LockedFile('filename', 'r+b', 'rb')
f.open_and_lock()
if f.is_locked():
print 'Acquired filename with r+b mode'
f.file_handle().write('locked data')
else:
print 'Aquired filename with rb mode'
f.unlock_and_close()
Author: cache@google.com (David T McWherter)
|
|||
|
CredentialsFileSymbolicLinkError Credentials files must not be symbolic links. |
|||
|
AlreadyLockedException Trying to lock a file that has already been locked by the LockedFile. |
|||
|
_Opener Base class for different locking primitives. |
|||
|
_PosixOpener Lock files using Posix advisory lock files. |
|||
|
LockedFile Represent a file that has exclusive access. |
|||
|
|||
|
|||
|
|||
logger = logging.getLogger(__name__)
|
|||
_FcntlOpener = None
|
|||
_Win32Opener = None
|
|||
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Thu Sep 6 13:36:11 2012 | http://epydoc.sourceforge.net |