Syntactic Confectionery Delight | |
PerlMonks |
Re: How to do atomic file locking?by Corion (Patriarch) |
on Aug 25, 2015 at 17:53 UTC ( [id://1139904]=note: print w/replies, xml ) | Need Help?? |
The trick is to ignore the open call in your sequence of locking. Two or more processes can (on Unixish operating systems) successfully call open() on the same file, but only one call to flock() will succeed. That should be enough for your program to know whether it is the instance that should proceed or not.
In Section
Seekers of Perl Wisdom
|
|