in reply to File Use
The straightforward way to do this is to use flock, but it's "advisory only." There are a couple of basic ways to flock a file (shared, exclusive), but if other programs don't use flock, you're out of luck.
If your program requests a flock and the file is already exclusively locked, your program knows not to open the file, but again, that doesn't work if the other programs don't bother to use flock. If you can't control the behavior of other programs, perhaps you should examine your requirements and determine an alternative.
Cheers,Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (Ovid -flock) Re: File Use
by qball (Beadle) on Apr 04, 2001 at 23:07 UTC | |
by Ovid (Cardinal) on Apr 04, 2001 at 23:18 UTC |