I'm trying to monitor a folder using C# and FileSystemWatcher. everything works well, except the fact that i can delete the folder i'm actually watching
I used to do this in C using ReadDirectoryChangesW, by creating a handle to the folder, and locking it, which prevented delete or rename from the user to that folder (i'm talking about the actual monitored folder, not it's contents)
Is there any way to lock that folder so people don't delete it while it's being watched?
(note that I don't want to change permissions to the folder because it might be on a FAT32 partition/usb drive/etc , which doesn't support permissions)