in reply to Re: flock - lordy me....
in thread flock - lordy me....
Because there's nothing in that sequence that refreshes the buffer between flock 2 and read, and yet someone else could have messed with the file to get your buffer and the file out of sync. So still, unflock is almost always a danger sign, even with the workaround.
In summary: unflock (flock 8) is not needed when you're about to close, and has to be handled very carefully if you're leaving the file open. Don't use unflock until you know why I say don't use unflock. {grin}
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Don't use unflock (flock 8). Ever.
by AgentM (Curate) on Jan 16, 2001 at 23:04 UTC | |
by merlyn (Sage) on Jan 16, 2001 at 23:11 UTC | |
by AgentM (Curate) on Jan 16, 2001 at 23:28 UTC |