good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Flocking in advanceby atl (Pilgrim) |
on Aug 11, 2000 at 15:14 UTC ( [id://27488]=note: print w/replies, xml ) | Need Help?? |
Locking something that doesn't exist is indeed not
possible. Checking on the existence of a file and then
opening/creating it will create you a race condition
you should avoid. Two solutions for your problem come to my
mind. First, if you want to stick to that approach, use a second (empty) file to do the locking on. Your (perl written?) compiler tries to get a lock on that file and doesn't do anything until he gets it (or maybe a timeout occurs). Another option is to use unique file names for the output, so multiple submissions can be made at any time. You might use a combination of username and timestamp, for example. Andreas
In Section
Seekers of Perl Wisdom
|
|