in reply to How to do atomic file locking?
The trick is to ignore the open call in your sequence of locking. Two or more processes can (on Unixish operating systems) successfully call open() on the same file, but only one call to flock() will succeed. That should be enough for your program to know whether it is the instance that should proceed or not.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to do atomic file locking?
by Acapulco (Novice) on Aug 25, 2015 at 20:44 UTC | |
by Acapulco (Novice) on Aug 25, 2015 at 20:45 UTC |