in reply to flock and read-ahead buffering on input
Your code example looks perfectly safe. Except note that flock doesn't do mandatory locking. Locking the file doesn't stop other processes doing something with the file; it only stops other processes locking the file. So if all processes that access the file are under your control, and you ensure that all such processes do a sysopen/flock before doing anything else with the file, then this code should be safe.
(Except if the file is being accessed over a network, in which case all bets are probably off)
Dave.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: flock and read-ahead buffering on input
by dbooth (Novice) on Apr 17, 2014 at 22:09 UTC | |
by dave_the_m (Monsignor) on Apr 18, 2014 at 07:55 UTC | |
by dbooth (Novice) on Apr 18, 2014 at 17:46 UTC | |
by dave_the_m (Monsignor) on Apr 18, 2014 at 22:47 UTC | |
by dbooth (Novice) on Apr 19, 2014 at 05:03 UTC |