in reply to Re^4: File locking
in thread File locking

Normally when I've done this, merely opening the file (without modifying it) is not a problem. If you really want to avoid opening the file when someone else already has it open, you'd have to use a separate file to lock on. That lock file would be open in several processes at once but only locked in one. The one that has the lock would be allowed to open the file you're really interested in.

That said, I don't see why this would be necessary. What concern do you have about having the file open in more than one process?