I have often used the algorithm described in LockFile::Simple by Rafael Manfredi which uses atomic operations of the file system. Not perfect but simple enough that it can be also implemented in pure shell (no external commands) which can be useful sometimes. It can even (mostly) work over NFS/NAS supposing a not-too-dumb NFS implementation.
The windows behavior is certainly confusing. what is the point of having a supposatly portable implementation of locking (perl's flock) if you cannot use it on some platform; I would rather have it die saying not implemented so that one knows a work-around is needed. I think it's a bug (at least a documentation bug)
hth --stephanIn reply to Re: Ensuring only one copy of a perl script is running at a time
by sgt
in thread Ensuring only one copy of a perl script is running at a time
by eyepopslikeamosquito
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |