FileSystemWatcher Problems

J

Jody L. Whitlock

Okay, so I'm getting a little confused at this. Why does the
FileSystemWatcher fire 2 events for everything? For instance, I'm
having it watch a file for when it is changed, and this event get's
fired twice. How do I stop that from happening?

Thanks,
Jody W

--
 
H

Herfried K. Wagner [MVP]

Jody L. Whitlock said:
Okay, so I'm getting a little confused at this. Why does the
FileSystemWatcher fire 2 events for everything? For instance, I'm
having it watch a file for when it is changed, and this event get's
fired twice. How do I stop that from happening?

This behavior is by design. Changes can consist of multiple changes even if
they appear to be a single change.
 
M

Michael D. Ober

That's what the underlying API reports. When you use the API directly, it's
even messier - you have to test every single event to see if it's for the
file (template) you're interested in and then turn the API back on.

Mike.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top