There's more than one way to do things | |
PerlMonks |
Re: Blank data fileby rah (Monk) |
on Jul 10, 2002 at 01:03 UTC ( [id://180657]=note: print w/replies, xml ) | Need Help?? |
All of these file locking schemes, leave open the possibility that another script (or instance of this script) could open the file before the lock is obtained. If that happens someone is going to get a blank file. You might consider using a semphore file for your lock mechanism. Take a look at the excellent article by Sean Burke in TPJ (Sysadmin Mag) from Feb 2002. He describes a very similar scenario and how he solved it with a semaphore.
In Section
Seekers of Perl Wisdom
|
|