Checking for duplicate instances of a script...

Guillaume Dargaud NOusenetSPAM at gdargaud.net
Wed Jan 21 15:25:54 CET 2004


> This can probably be done in *many* different ways, maybe there is
> even an agreed upon on best solution. This is a small suggestion
> based on fcntl.flock() (Unix only I am afraid):

Wrong prediction: it works fine in Cygwin under windows, but it doesn't on
my linux server...

Traceback (innermost last):
  File "./CounterTest.py", line 24, in ?
    fcntl.flock(lockH, fcntl.LOCK_EX | fcntl.LOCK_NB)
TypeError: illegal argument type for built-in operation


Cygwin:
2.3.3 (#1, Dec 30 2003, 08:29:25)
[GCC 3.3.1 (cygming special)]

Linux:
1.5.2 (#1, Jan 31 2003, 10:58:35)  [GCC 2.96 20000731 (Red Hat Linux 7.3 2

Is this too old ?

Maybe I'll try with os.open flags...
-- 
Guillaume Dargaud
http://www.gdargaud.net/
  "My goal is to be a meteorologist. But since I possess no training in
meteorology, I suppose I should try stock brokerage."    - Found in a
resume.





More information about the Python-list mailing list