File Locking Forced? Newbie question.

Tim Golden mail at timgolden.me.uk
Tue Jul 15 13:38:43 EDT 2008


Sparky wrote:
> 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 I
> have it so that the same file can be open in read mode by more than
> one person or could Window's file locking system get in the way?

Assuming your question is: can processes A, B & C read
from the same file at the same time, then: Yes. (You
can try it out yourself fairly easily if you want. Just
open a clutch of interpreter windows and do some
open ("abc.txt", "r").read () stuff in each one).

But I'm surprised you think that anything might get
in the way of that. It would be a fairly limiting file
system which prevented multiple simultaneous readers.

TJG



More information about the Python-list mailing list