This package contains a single module, which implements a platform independent file lock in Python.
The lock includes a lock counter and is thread safe. This means, when locking the same lock object twice, it will not block.
import filelock
lock = filelock.FileLock("my_lock_file")
with lock:
pass
try:
with lock.acquire(timeout = 10):
pass
except filelock.Timeout:
pass
What this filelock is not
A filelock provides a synchronisation mechanism between different instances of your application, similar to a thread lock. It can be used to signalize that files, directories or other resources are currently used or manipulated (Think of a sync.lock file). Only the existence of the lockfile is watched for this purpose. The file itself can not be written and is always empty.
Perhaps you are looking for something like
Documentation
The full documentation is available on readthedocs.org.
Contributions
Contributions are always welcome. Never hesitate to open a new issue.
License
This package is public domain.
Metadata
Release files for filelock 2.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| filelock-2.0.13.tar.gz | 5.6 kB | Details |
Release files / filelock-2.0.13.tar.gz
| Download URL | filelock-2.0.13.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d05079e7d7cae7576e192749d3461999ca6b0843d35b0f79f1fa956b0f6fc7d8
|
|
BLAKE2b-256 checksum How to use checksums |
454c810fb0481b80766fd731981f93ce298fe36e4955ab7524ae66836499d743
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |