Recursive Use of ReadDirectoryChanges
I want to watch all changes in a directory recursively, i.e. if watching C:\
I want to receive notifications for
C:\1.txt
C:\A\1.txt
If I use ReadDirectoryChanges
with watchSubtree
option enabled, it reports only
C:\1.txt
C:\A
It does not work recursively.
How can I make it work recursively? Do I really need to call ReadDirec开发者_运维技巧toryChanges
for each subdirectory recusively? What if new subdirectories are created / subdirectories get deleted?
Thanks for any help.
You can look at DirectoryWatch component which works. I use it in production code so I know it works correctly, even for subdirs.
You probably want change journals if you're trying to watch the whole disk.
精彩评论