in reply to Re^4: File Locking Problem
in thread File Locking Problem
Perhaps you could try touching the file and then opening the read/write handle. If the file isn't there, touch will create it. If the file is there, touch won't hurt it (unless the timestamp is of importance to you, but if you're about to write to it you're going to change that anyway). The only danger is that the file might be deleted in between the touch and the open, but that should be a relatively short danger zone (and it will make the code a bit simpler).