How can I monitor a Windows directory for changes?

后端 未结 7 1978
感情败类
感情败类 2020-11-29 22:32

When a change is made within a directory on a Windows system, I need a program to be notified immediately of the change.

Is there some way of executing a program whe

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 23:06

    This question helped me a lot to understand the File Watcher System. I implemented ReadDirectoryChangesW to monitor a directory and all its sub directories and get the information about change in those directories.

    I have written a blog post on the same, and I would like to share it so it may help someone who land up here for the same problem.

    Win32 File Watcher Api to monitor directory changes.

提交回复
热议问题