We have several .NET applications that monitor a directory for new files, using FileSystemWatcher. The files are copied from another location, uploaded via FTP, etc. When th
Unless the contents of a file can be verified for completion (it has a verifiable format or includes a checksum of the contents) only the sender can verify that a whole file has arrived.
I have used a locking method for sending large files via FTP in the past.
File is sent with an alternative extension and is renamed once the sender is happy it is all there.
The above is obviously combined with a process which periodically tidies up old files with the temporary extension.
An alternative is to create a zero length file with the same name but with an additonal .lck extension. Once the real file is fully uploaded the lck file is deleted. The receiving process obviously ignores files which have the name of a lock file.
Without a system like this the receiver can never be sure that the whole file has arrived.
Checking for files that haven't been changed in x minutes is prone to all sorts of problems.