By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Question about FileSystemWatcher

P: n/a
Question about FileSystemWatcher:
How can I determine if a delete notification was
a file or a directory. I was using the DirectoryInfo.exists
method to determine if I am receiving file or direcory
notifications, but with the delete notification the file is no
longer there, so I don't know how to find out if the path
was a file or a directory?
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Dinny,
As you found out the file or directory does not exist any longer in Deleted
event.

You may try using two FileSystemWatcher objects. One that watches for
Directories only and the second watches for Files only.

Unfortunately I have not used FileSystemWatcher enough to know what
properties you need to set to get a FileSystemWatcher to watch for
Directories only...

I'll post something if I come up with something...

Hope this helps
Jay
"dinny" <nospam> wrote in message
news:uR**************@TK2MSFTNGP11.phx.gbl...
Question about FileSystemWatcher:
How can I determine if a delete notification was
a file or a directory. I was using the DirectoryInfo.exists
method to determine if I am receiving file or direcory
notifications, but with the delete notification the file is no
longer there, so I don't know how to find out if the path
was a file or a directory?

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.