Re: Putting a lock on file.

2005-09-18 Thread Steven D'Aprano
On Sat, 17 Sep 2005 23:58:58 -0700, Harlin Seritt wrote: > I have a file that a few different running scripts will need to access. > Most likely this won't be a problem but if it is, what do I need to do > to make sure scripts don't crash because the input file is in use? > Would it be best to run

Re: Putting a lock on file.

2005-09-18 Thread tiissa
Harlin Seritt wrote: > I have a file that a few different running scripts will need to access. [...] > This may seem nice on paper but I hate to run a while for an > indeterminate amount of time. Is there anything else that can be done > that would be better? On posix systems, there is a fcntl mod

Putting a lock on file.

2005-09-18 Thread Harlin Seritt
I have a file that a few different running scripts will need to access. Most likely this won't be a problem but if it is, what do I need to do to make sure scripts don't crash because the input file is in use? Would it be best to run a loop like the following: flag = 0 while not flag: try: