Reading file issue

Tim Chase python.list at tim.thechases.com
Mon Jan 28 07:14:53 EST 2013


On Mon, 28 Jan 2013 03:47:07 -0800 (PST) loial <jldunn2000 at gmail.com>
wrote:

> I am parseing a file to extract data, but am seeing the file being
> updated even though I never explicitly write to the file. It is
> possible that another process is doing this at some later time, but
> I just want to check that opening the file as follows and ignoring
> a record would not result in that record being removed from the
> file.

The only complication I'd see would be the reader bombing out because
the writer process is in the middle of writing.  A quick test on
WinXP showed that it's possible to continue to write to a file that
another process has open for reading (this shouldn't be an issue on
POSIX OSes; Win32 can be a bit more fascist about sharing files,
especially if they're both open for writing). However, that doesn't
alter the data written, so all it takes is just re-running the reader
process.

-tkc





More information about the Python-list mailing list