in reply to The necessity of flock-ing files that are only to be read.

Just one quick comment.

While it is implicit in Joost's comment it's worth saying that flock() based locks are co-operative - they're only effective for those programs that choose to use flock().

While having shared locks is a good thing if all the processes accessing the file are using flock() based locking, it will be of no use at all if there is some other process that just writes to the file without getting an exclusive lock first.

Just thought it was worth making explicit :-)

  • Comment on Re: The necessity of flock-ing files that are only to be read.