开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜