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 |
Undocumented |
Constant | LOCK |
Undocumented |
Constant | LOCK |
Undocumented |
Constant | LPOVERLAPPED |
Undocumented |
Class | _OFFSET |
Undocumented |
Class | _OFFSET |
Undocumented |
Function | _fd |
Get a filedescriptor from something which could be a file or an fd. |