>This isn't reliable. Someone else can grab the file between the FLOCK() and the USE EXCLUSIVE.
I've heard that said, but it's almost impossible to prove it without some kind of artificial looping, it's so fast. Never yet seen a conflict in years of doing this from way back using it in C years ago. But my general rule on this is simply one of consequences: If no harm is done with a missed USE EXCL on a lock, go for that method if you want. If it can cause trouble, don't.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.