ReadDirectoryChangesW File Moved Workaround

Background

Windows API for monitoring file-system changes ReadDirectoryChangesW cannot reliably report a file move operation. Instead it just notifies Deleted + Created.

Question

What workarounds can be implemented to achieve such a 'Move Event' effect on Windows? I'm sure I'm not the first one who's dealt with this.


My own first thoughts were to save SHA1 sums of everything in the monitored directory (perhaps in a SQLite database) and compare the changed file with the SHA1s, so that if a delete+create happens and their sha1 sums match, we can safely assume it was a move operation. This feels a bit overkill though, I'm wondering if anyone else has already figured out some better workaround.

Any ideas?

链接地址: http://www.djcxy.com/p/58346.html

上一篇: 检测来自node.js的文件内容更改

下一篇: ReadDirectoryChangesW文件已移动解决方法