0

I'm monitoring directory changes in Windows with Python win32 module. The task is to capture CREATE, DELETE, and MODIFY events for both files and directories recursively in a specified directory. NotifyFlag is set like this:

FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE

The problem is duplicated events may be return and I can't figure out why, for example, a simple modification on file will result in 3 file update notifications -- exactly, two sets of notifications issued: the first set contains only 1 update notification and the other 2 -- all on the same file.

Also, any approach to eliminate duplicated events?

Thanks and Best regards!

Summer_More_More_Tea
  • 12,740
  • 12
  • 51
  • 83
  • You need to store a tuple of in a map and check each. If a margin of error is OK, you can store the hash of the name instead. – Mahmoud Al-Qudsi Jun 27 '12 at 04:00
  • Does this happen for every editor? It could just write/edit in chunks rather than a single write of all the data. – Deanna Jun 27 '12 at 08:25

0 Answers0