FileLock
FileLock copied to clipboard
What if somehow the lock is not removed
If the process somehow fails to remove the lockfile, e.g. because the process (or system) crashes, the lockfile is left in place.
~~I think that this can be dealt with simply by attempting to remove the lockfile; if the process holding the lock is still alive, this will raise an error, otherwise the lockfile is deleted and the lock can be acquired by the current process. Though perhaps I am missing something?~~ edit: That only works on Windows