Be careful to read all the implementation notes for flock. I used to use it to ensure atomicity all the time, but had run into a few circumstances where it worked fine under stress tests in one environment but would eventually fail in another.
I never did fully isolate the problem to a coding error, but found refernces to implementation issues that matched my circumstances.
I ultimately found other ways to achieve reliable atomicity and have had no need to go back. But oh, once implemented properly in an environment where it worked, flockwas graceful.
In reply to Re: How to do atomic file locking?
by marinersk
in thread How to do atomic file locking?
by Acapulco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |