By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,429 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

File Locking Conflicts - Are there any pitfalls ?

P: n/a
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.
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 6 Jul 2004 06:10:08 -0700,
ge********@hotmail.com (Geoffrey) wrote:
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.


"The same underlying OS" may not be sufficient. Your "primary"
application may have other locking mechanisms built on top of the
low-level OS-provided locks, or require that applications acquire
those locks in a particular order, or impose other restrictions.

I would check with the vendor/documentation of your "primary"
appliction; they would be the authority on a question like this.

Regards,
Heather

--
Heather Coppersmith
That's not right; that's not even wrong. -- Wolfgang Pauli
Jul 18 '05 #2

P: n/a
> "The same underlying OS" may not be sufficient. Your "primary"
application may have other locking mechanisms built on top of the
low-level OS-provided locks, or require that applications acquire
those locks in a particular order, or impose other restrictions.

I would check with the vendor/documentation of your "primary"
appliction; they would be the authority on a question like this.

Regards,
Heather


I am fairly certain that it is just using the filesystem locks. There
is no documentation and the vendor won't release the info. So ...

I was wondering how python addresses file locking as we can't find any
reference to this in the python manuals/docs.

Is there any modules with in python that would help me
diagnose/decipher this ?? I checked win32all and did see anything
specific to file locking.

On win32 the application provider does suggest that you "disable"
microsoft's opportunitic locking scheme as this may cause data
integrity issues.

Any hints on the python side ??
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.