module documentation

Portable file locking utilities. Based partially on an example by Jonathan Feignberg in the Python Cookbook [1] (licensed under the Python Software License) and a ctypes port by Anatoly Techtonik for Roundup [2] (license [3]). [1] https://code.activestate.com/recipes/65203/ [2] https://sourceforge.net/p/roundup/code/ci/default/tree/roundup/backends/portalocker.py # NOQA [3] https://sourceforge.net/p/roundup/code/ci/default/tree/COPYING.txt Example Usage:: >>> from django.core.files import locks >>> with open('./file', 'wb') as f: ... locks.lock(f, locks.LOCK_EX) ... f.write('Django')

Class OVERLAPPED Undocumented
Function lock Undocumented
Function unlock Undocumented
Constant LOCK_EX Undocumented
Constant LOCK_NB Undocumented
Constant LOCK_SH Undocumented
Constant LPOVERLAPPED Undocumented
Class _OFFSET Undocumented
Class _OFFSET_UNION Undocumented
Function _fd Get a filedescriptor from something which could be a file or an fd.
def lock(f, flags): (source)

Undocumented

def unlock(f): (source)

Undocumented

Undocumented

Value
2

Undocumented

Value
1

Undocumented

Value
0
LPOVERLAPPED = (source)

Undocumented

Value
POINTER(OVERLAPPED)
def _fd(f): (source)

Get a filedescriptor from something which could be a file or an fd.