Home All Groups Group Topic Archive Search About

FileSystemWatcher any experts here?

Author
27 Apr 2006 5:32 PM
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

Author
27 Apr 2006 5:48 PM
Tim
can you check if the file is "in use"?
the ftp client will keep the file in use until the upload is complete.
Author
28 Apr 2006 3:29 PM
Jeff Waskiewicz
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

Show quoteHide quote
"DWalker" wrote:

> 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
>