in reply to Re: How to do atomic file locking?
in thread How to do atomic file locking?

Thanks for the advice. Yes, I'm aware this solution is only "advisory-based", but since I'm creating the lock file ex profeso for this and I'm sure this won't be residing in a network file system and other such nuances I believe it should work fine

Regarding the file flushing, I was not aware of this but it definitely makes sense, otherwise we might end up with inconsistencies. Fortunately though, in my particular use case I usually open the shared file write something and close it immediately and as far as I can tell, close should flush.

Again, thanks a lot for the advice. I like to be extra careful since I know concurrency is very easy to get wrong