in reply to (OT?) File Locking
use Fcntl ':flock'; # ... code ... open FH, ">>$file" or die "Can't open $file: $!"; flock FH, LOCK_EX; # lock it # ... print() to file here flock FH, LOCK_UN; # not really necessary since close() # will unlock the file anyway close FH; # ... code ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (OT?) File Locking
by dws (Chancellor) on Apr 14, 2002 at 17:39 UTC | |
by no_slogan (Deacon) on Apr 14, 2002 at 18:37 UTC | |
by dws (Chancellor) on Apr 14, 2002 at 19:26 UTC | |
by tye (Sage) on Apr 14, 2002 at 20:16 UTC |