in reply to Re: how to exit if tool is already running
in thread how to exit if tool is already running
The easiest is to check for the existence of a special file on a start-up if the file not exists create a temporary file and delete this file after the script has finished.That's not easy at all. In fact, if you do it as you state, you have a solution with a race condition, as you aren't doing the "check if a file exists; create it otherwise" atomically. Furthermore, you have a problem if the program dies and doesn't get the chance to clean up the special file. Or if something else removes the file.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to exit if tool is already running
by proceng (Scribe) on Aug 13, 2010 at 12:22 UTC | |
by JavaFan (Canon) on Aug 13, 2010 at 14:03 UTC |