Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
It then starts reading the file. Before Process1 gets done, Process2 comes along and wants to write to the file. Process2 does:open HANDLE, "$file" or die "Can't open: $!"; flock(HANDLE, LOCK_SH); #could use LOCK_EX, it doesn't prevent this p +roblem
open WRITER, ">$file" or die "Can't open: $!"; flock(WRITER, LOCK_EX);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File Locking Problem
by diotalevi (Canon) on Jul 28, 2004 at 17:03 UTC | |
by Anonymous Monk on Jul 28, 2004 at 21:07 UTC | |
by diotalevi (Canon) on Jul 28, 2004 at 21:26 UTC | |
by Anonymous Monk on Jul 29, 2004 at 11:12 UTC | |
by Anonymous Monk on Jul 29, 2004 at 13:11 UTC | |
by Anonymous Monk on Jul 28, 2004 at 20:10 UTC | |
|
Re: File Locking Problem
by graff (Chancellor) on Jul 29, 2004 at 03:42 UTC | |
|
Re: File Locking Problem
by Anonymous Monk on Jul 28, 2004 at 17:03 UTC |