Home All Groups Group Topic Archive Search About

FileSystemWatcher question

Author
26 Jan 2006 3:40 AM
nbrege
I am writing a program that watches a certain folder for incoming files &
then moves those files to another folder. Here's the problem: if I copy a
group of files into the watched folder it works fine, but if I move a group
of files into the watched folder it doesn't do anything, the event handler
never triggers. What is the proper notify filter to use to watch for new
files in a folder? I have tried both the Size & LastWrite filters but neither
does what I want. Why does it work when I copy files into the folder but not
when I move them?  Any help would be appreciated.

Author
26 Jan 2006 9:18 AM
Jarod_24
"nbrege" <nbr***@discussions.microsoft.com> wrote in message
news:08377BBC-8715-4330-AA64-D6617968E664@microsoft.com...
>I am writing a program that watches a certain folder for incoming files &
> then moves those files to another folder. Here's the problem: if I copy a
> group of files into the watched folder it works fine, but if I move a
> group
> of files into the watched folder it doesn't do anything, the event handler
> never triggers. What is the proper notify filter to use to watch for new
> files in a folder? I have tried both the Size & LastWrite filters but
> neither
> does what I want. Why does it work when I copy files into the folder but
> not
> when I move them?  Any help would be appreciated.

maybe the .Create filter (if there is one)

the filewatcher got several events that you can subscribe to like .Changed
..Error .Renamed and so on.
subscribe to them all and see which one triggers when you move the files
into the folder.

Addhandler, filesystemwatcher.Changed, AddressOf yourmethod


sub yourmethod(sender, e)
'code here
en sub