in reply to Extract the middle part of a list
You can have a problem where something like this happens:
One might argue that the writing process couldn't stall for long enough for this to happen, but that depends on the size of the file being written, whether it now (or in the future) will be writing over a network, whether the writing process has to wait to get more data, etc.
The safe way to do this (which you might already be doing) is for the reader and writer to agree on a pattern match of files to ignore (e.g. *.tmp). The writer can then create and write to a x-y-z.tmp file, flush and sync it to disk and then do a rename() on it once it's finished.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Extract the middle part of a list
by chrism01 (Friar) on Jun 29, 2007 at 07:19 UTC | |
by jbert (Priest) on Jun 29, 2007 at 07:35 UTC |