On Tue, Jul 18, 2000 at 07:43:06PM +0200, Louis-David Mitterrand wrote:
> On second thought, why would a reader need to _acquire_ any locks on
> such partly-written files? Simply acknowledging locks created by writers
> is enough to avoid reading partly-created files; this doesn't need write
> access, or am I (still) missing something?

Race condition.

Reader looks for lock... doesn't see it.
Writer creates lock, starts writing file.
Reader opens and reads partially written file.

It's worse on the win32 server, where, if the reader has the file open, the
writer can't update the file!  (At least under Unix, the write could
write/rename/unlink files that are open by others without issues).

mrc
-- 
       Mike Castle       Life is like a clock:  You can work constantly
  [EMAIL PROTECTED]  and be right all the time, or not work at all
www.netcom.com/~dalgoda/ and be right at least twice a day.  -- mrc
    We are all of us living in the shadow of Manhattan.  -- Watchmen

Reply via email to