testing if another instance of a script is already running

skip at pobox.com skip at pobox.com
Sun Sep 14 15:21:37 CEST 2008

    Aaron> Would it suffice to call 'os.open' with flags= _O_CREAT| _O_EXCL
    Aaron> ?  Would that be platform-independent?

I suspect it would be platform-independent but not NFS-safe.  (The other
solutions in lockfile might have NFS problems as well.  In any case,
lockfile provides a bit more functionality as well, including timeouts and
the ability to break locks.


More information about the Python-list mailing list