File Locking Forced? Newbie question.

Sparky Samnsparky at gmail.com
Tue Jul 15 14:16:09 EDT 2008


On Jul 15, 11:38 am, Tim Golden <m... at timgolden.me.uk> wrote:
> 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

Thank you. For some reason I thought there was a file locking system
on Windows (http://en.wikipedia.org/wiki/
File_locking#File_locking_in_Microsoft_Windows). But, I believe that
that only applies to those using Microsoft's file methods and only for
writing. Thanks for clearing that up.

Sam



More information about the Python-list mailing list