| oauth2client.locked_file | index /home/jcgregorio/projects/clean/oauth2client/locked_file.py |
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()
| Modules | ||||||
| ||||||
| Classes | ||||||||||||||||||
|
| ||||||||||||||||||
| Data | ||
| __author__ = 'cache@google.com (David T McWherter)' logger = <logging.Logger instance> | ||
| Author | ||
| cache@google.com (David T McWherter) | ||