开发者

Recursive Use of ReadDirectoryChanges

开发者 https://www.devze.com 2023-03-09 01:20 出处:网络
I want to watch all changes in a directory recursively, i.e. if watching C:\\ I want to receive notifications for

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开发者_运维技巧toryChangesfor 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消