While experimenting with FileSystemWatcher, I found that it somehow exceeded my user account permissions for files and folders and would increase change events with information about what changed in files and folders that you donโt even have access to.
I have two questions:
1) Why is this happening?
2) Is this a problem in the AD configuration? how to fix it?
3) Is there a way to collect these files or even create FileSystemInfo from them to get more information about the files (and not just the changes made to them)?
As far as I tried, only FileSystemWatcher is immune to restrictions, I cannot run any other thing on it, here is a list of what I tried:
- File.exists
- Directory.Exists
- FileInfo instance for found files
- DirectoryInfo instance for found files
- File.copy
- File.Delete
Update : a tried and tested helge solution, with something similar to what it launched, not via the windows api, but on the command line:
robocopy / B \ myserver \ folder c: \ somefolder
The best team name.
You can verify with robocopy that / B stands for โbackup mode,โ and this is what suggested the excess would be the reason for this security.
I will try something, I want to find out what exactly makes FileSystemWatcher browse folders, I do not have permission to open it. Knowing why, I want to learn how to block FileSystemWatcher, and how to collect found files.
I would do a survey if I was with my personal account. Please can someone help me? I will write a blog post about this decision, among other things, which may help someone with the same doubts in the future.
Devexpp
source share