473,496 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

File Locking Conflicts - Are there any pitfalls ?

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
2 1796
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
> "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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5799
by: Kamus of Kadizhar | last post by:
Thanks to Robert Brewer, I got enough insight into logging to make it work.... Now I have another issue: file locking. Sorry if this is a very basic question, but I can't find a handy reference...
3
3750
by: Hugz | last post by:
Hello, And Thank you for taking time to help me.Myself Hugz.I am new to perl and want to write my own Scripts.But i can't understand how perl "rename" function and "file locking" works. ...
2
2838
by: Scott Bryce | last post by:
I am creating a CGI application in Perl that uses an Access database. It will be hosted on an NT server. I have used flat file DBMs (tied hashes) on UNIX servers, but I am not familiar with how...
4
1710
by: Stanley Cheung | last post by:
Hi all, Anyone have a "File Locking" experience? I want to ask if the application can prevent 2 user access (concurrently) to file for content editing... any lock and unlock mechanism...
4
1575
by: darrel | last post by:
I've been dealing with a file locking issue for a while. Our CMS spits out a new XML file each time an item in the DB is updated. This XML file is basically our site menu, and is what we use on...
2
1563
by: Dr. Who | last post by:
I'm always disappointed when I find something that Python doesn't handle in a platform independent way. It seems to me that file locking is in that boat. 1. I don't see a way to atomically open...
15
5202
by: Matt Brandt | last post by:
I am trying to get multiple threads to lock specific regions of a file. However, since each thread has the same PID, it appears that a lock by one thread does not block another thread from the same...
1
1761
by: =?Utf-8?B?REZTIEhFTFAgV0FOVEVE?= | last post by:
We are currently testing the Microsoft technology of Distributed File System Replication with DFS Namespaces which is working perfectly, however from the Microsoft documentation surrounding these...
2
1009
by: Sparky | last post by:
Hello! I am writing some software that will have many users accessing the same file resource at once for reading purposes only. I am programming on (Ubuntu) Linux and my question is in Windows, can...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.