in reply to Re: correct usage of flock?
in thread correct usage of flock?
I think this is a good way to go about it. However, if it's likely that separate invocations of this program will occur, a random filename would be a Good Thing.
There's also the tried and true trick of writing a sentinal file that other programs check for and then seeking to the beginning of the original file and truncating it, but renaming seems much easier.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|