I have a NFS mount that files (sometimes of some size) are being written to by a different system, and right now I'm polling for new files. I need to wait until the file is fully complete before processing it with my script. I don't control the process that's writing these files or their names.
It seems that fuser and lsof check my local system, but don't properly handle if a different system is writing to the NFS mount. I don't believe I can listen for file events if it's v3 (but I can for v4?), and short of waiting some amount of time for the file size to stop growing (and praying the network doesn't have hiccups), I don't know of a way to guarantee it's complete like you could locally by looking for file handles. Is there a solution for this? If not, is there a solution that would work with NFSv4?