| Next | File Locking | 11 |
open S, "> somefile.sem" or die ...;
flock S, LOCK_EX or die ...;
open F, "> somefile" or die ...;
# Now write F
close F;
close S;
Use a semaphore file
The file you lock need not be the one that has the data in it
The semaphore file solution solves a lot of locking problems
| Next | ![]() |
Copyright © 2003 M. J. Dominus |