Skip to main content

Platform-independent file locking module

Project description

The lockfile package exports a LockFile class which provides a simple API for locking files. Unlike the Windows msvcrt.locking function, the fcntl.lockf and flock functions, and the deprecated posixfile module, the API is identical across both Unix (including Linux and Mac) and Windows platforms. The lock mechanism relies on the atomic nature of the link (on Unix) and mkdir (on Windows) system calls. An implementation based on SQLite is also provided, more as a demonstration of the possibilities it provides than as production-quality code.

Note: In version 0.9 the API changed in two significant ways:

  • It changed from a module defining several classes to a package containing several modules, each defining a single class.

  • Where classes had been named SomethingFileLock before the last two words have been reversed, so that class is now SomethingLockFile.

The previous module-level definitions of LinkFileLock, MkdirFileLock and SQLiteFileLock will be retained until the 1.0 release.

To install:

python setup.py install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lockfile-0.11.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lockfile-0.11.0-py2-none-any.whl (13.3 kB view details)

Uploaded Python 2

File details

Details for the file lockfile-0.11.0.tar.gz.

File metadata

  • Download URL: lockfile-0.11.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lockfile-0.11.0.tar.gz
Algorithm Hash digest
SHA256 eed7e0c829135aaaf2a9df83652bc6e2cc50175d933741c25aac0394674e7fd3
MD5 494b449935f95f0f62e621b5f52640f8
BLAKE2b-256 64612e2b7424f5751f66f37ac12e10ffe94ea4b5bcccc697eccb19142bcf7c54

See more details on using hashes here.

File details

Details for the file lockfile-0.11.0-py2-none-any.whl.

File metadata

File hashes

Hashes for lockfile-0.11.0-py2-none-any.whl
Algorithm Hash digest
SHA256 6591deec873a9ccccc5aeb35a1146e065cc6cd0fdaf0786da8b7b84c31d41455
MD5 1a6f33ce16532d9ec8ba019a4f77f3b3
BLAKE2b-256 73839474c4a257b75b9a08aacd7de0a30ad97d9cdaeb1cbf48efa46bcb1969ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page