in reply to Strange flock results?
In the writing routine:
at the point you release the lock the printed address will usually still be in the output buffer in memory, not written to disk.flock $FH, LOCK_EX or die "Flock failed: $!\n"; seek $FH, 0, 2 or die "Seek failed: $!\n"; print $FH "$address\n"; flock $FH, LOCK_UN or die "unFlock failed: $!\n";
See 'perldoc -q flush' for various ways to ensure that the output is flushed to disk before you release the lock.
Hugo
|
|---|