If you unlink after opening but before before processing that would reduce the race window. On a local filesystem that fully removes the file from the directory listing, but as I understand it, over NFS it does a rename to ".nfsXXXX" rather than an unlink. Other processes would ignore such file names. If it were me, I'd experiment with manually doing the rename just to make sure I was certain about the rename pattern. You may also need to periodically clean up or process old .nfsXXX files in case something crashes during processing.
Update: ... or just flat-out rename before opening (to .processingXXXX-ORIGINALNAME) using the rename as a lock operation?
Good Day,
Dean
In reply to Re: NFS File Locking
by duelafn
in thread NFS File Locking
by jbw8387
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |