in reply to How to apply flock

It might be worth mentioning here (although it may not apply to this case) that in many Unix implementations the flock() call is advisory. That is to say, only programs looking for a lock, will treat it as locked. However (at least under Solaris) you can use the SGID bit on the file to (err . . could be the SUID bit . . can't remember) to trigger a mandatory lock that will effect any/everything. Most heartily suggest a read of your local flock(3) man page to be sure how your OS of choice handles it.

Hope this helps someone.

-anelson