File Locking Conflicts - Are there any pitfalls ?

Geoffrey geskerrett at hotmail.com
Tue Jul 6 15:10:08 CEST 2004


We have developed a python class that can read data files created from
another application.  These target files are C-ISAM files used for
accounting applications so the "primary" application may be reading
and/or writing to portions of the files ("records") at the same time.

The python class we developed opens the requested file in 'rb' mode,
reads the file header (first 512k) and  using information supplied in
the file header (such as record length, etc), reads "records" from
specific file locations.  At no time does the python class do any
writing of data, it is strictly read only.

Using this class we plan develop a Python application.  Our app plus
the the "primary" application will reside on the same machine or at
least be using the same operating system (some flavour of win32).  In
addition the primary application is "multi-user" so there may be 10-12
workstations reading/writing to the same file the the python app is
reading.

What we haven't been able to ascertain is whether or not there are any
potential "conflicts" between reading and processing the file in
python if the "primary" application also reading/writing and
processing the file.

It is our understanding that as long as the python app is "read only"
and both apps are using the same file locking mechanism (ie. the same
underlying OS), there should not be any conflicts.

If someone could point me in the right direction - comments, links,
etc - I would really appreciate it.



More information about the Python-list mailing list