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.

Download from:

http://code.google.com/p/pylockfile/

To install:

python setup.py install

The above code.google.com URL is also the place to report bugs.

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.9.1.tar.gz (21.4 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for lockfile-0.9.1.tar.gz
Algorithm Hash digest
SHA256 23da589c91f59cb7c644d5ce5df539d448341bd479917d6dde973f82e2719147
MD5 ce61468d4c1263e3005737bbed2641f0
BLAKE2b-256 fb89af965281e233d8722002a4b7b7b0b650d46875d03faa7e83a1463d6789e1

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