in reply to Flocking in advance

Locking something that doesn't exist is indeed not possible. Checking on the existence of a file and then opening/creating it will create you a race condition you should avoid. Two solutions for your problem come to my mind.

First, if you want to stick to that approach, use a second (empty) file to do the locking on. Your (perl written?) compiler tries to get a lock on that file and doesn't do anything until he gets it (or maybe a timeout occurs).

Another option is to use unique file names for the output, so multiple submissions can be made at any time. You might use a combination of username and timestamp, for example.

Andreas