I have already managed to see file and folder changes using FileSystemWatcher.
My problem is that I cannot distinguish between files and folder. It is possible that the file and folder have the same path names.
For a delete event, I can't even use the dirty workarround with testing File.Exists (path) or Directory.Exists (path), because the file / folder is already deleted when the method is called.
Perhaps this object has information that I need, but I did not find it:
FileSystemEventArgs e
I just want to know if the changed item was a file or folder.
source
share