in reply to Update in-place with temporary file and flocking
rename "file1", "file2"; my $fh = new IO::File("file1","w") flock($fh,LOCK_EX) or die "can't get lock"; my $fh2 = new IO::File("file2","r"); #read fh2 write to $fh flock($fh,LOCK_UN); # perhaps delete file2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Update in-place with temporary file and flocking
by geohar (Acolyte) on Feb 18, 2004 at 16:52 UTC | |
by borisz (Canon) on Feb 18, 2004 at 18:50 UTC | |
by geohar (Acolyte) on Feb 18, 2004 at 20:00 UTC |