Re: Locking a file under Windows

2005-11-24 Thread Guy Lateur
Correction: it's probably best to use the Flock class by John Nielsen. Much cleaner and working great. Info can be found here: http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/Windows_NT_Files_.2d.2d_Locking.html Best regards, g "Guy Lateur" <[EMAIL PROTECTED]> schreef in berich

Re: Locking a file under Windows

2005-11-24 Thread Gregory Piñero
I'd be more worried about two users writing to the file at the same time.  I don't have much experience in that area though so maybe someone could chime in on if that's a legitimate worry or not. -Greg On 11/24/05, Tim Golden <[EMAIL PROTECTED]> wrote: [Guy Lateur]> I'm working on an application t

Re: Locking a file under Windows

2005-11-24 Thread Guy Lateur
Thank you, Tim. The portalocker code seems to prevent reading while the file is locked for writing, but it doesn't seem to prevent multiple writes (nor multiple exclusive locks, for that matter). I guess it'd be better if I use the second suggestion, i.e. temporarily renaming the file for writ

RE: Locking a file under Windows

2005-11-24 Thread Tim Golden
[Guy Lateur] > I'm working on an application that will be used by several users at the same > time. The user should be able to both read and write to some data file > stored on our file server. My question is: how can I prevent that one user > writes to the file while another user is reading it?

Locking a file under Windows

2005-11-24 Thread Guy Lateur
Hi all, I'm working on an application that will be used by several users at the same time. The user should be able to both read and write to some data file stored on our file server. My question is: how can I prevent that one user writes to the file while another user is reading it? I've seen