FileSystemWatcher any experts here?

  • Thread starter Thread starter DWalker
  • Start date Start date
D

DWalker

I need to monitor a folder to see when a file that is being FTP'ed into the
folder is finished.

I have looked at the doc for the FileSystemWatcher and the Created event.
It's not clear from the doc whether that event is fired when the file is
first created (sounds like it is), but I need some way to know when the FTP
transfer into the directory is FINISHED. As in, the file is closed or
something. Does closed correspond to created?

Is there a way to do this? Am I missing something?

Thanks.

David Walker
 
can you check if the file is "in use"?
the ftp client will keep the file in use until the upload is complete.
 
Maybe you could do something with the Attributes Monitor by looking at...

NotifyFilters.Attributes.LastWrite
NotifyFilters.Attributes.LastAccess
NotifyFilters.Attributes.Size

....I don't know how or if they update during the FTP process but if say size
and writetime do not change over x period then the file is complete.

Jeff
 
Back
Top