Next | The Perl Hardware Store | DC.pm Version | 24 |
if (something()) { open F, $FILE or die ...; flock F, LOCK_SH; print while <F>; } else { open F, "> $FILE" or die ...; flock F, LOCK_EX; my $data = qx{some command}; print F $data; }
Oops, it's still wrong
Maybe we can lock the file before we open it? ... Nope
Maybe the writer can open in update mode,
lock the file,
seek to the beginning,
overwrite the contents,
call truncate...
continued...
Next | Copyright © 2003 M. J. Dominus |