lockfile

Platform-independent file locking module

Here are some articles that you may find helpful