-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No Modify event on existing files #54
Comments
Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann). The modification is recognized when file size changed only. |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). You are right! This is my fault, and the fix is simple, but there's a problem, IO Completion Ports will report 2 notifications events for the modified file ( it's a known issue ), and i need to add a filter to avoid reporting two times the same event. If you need a quick fix i can commit the fix without the filtering, but i prefer to commit the fix when is really fixed. Thanks for reporting it, i'll try to fix this ASAP, since is critical. |
Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann). I already found the simple fix myself (added FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_LAST_ACCESS to CreateWatch call in FileWatcherWin32). Now I get the two notifications you talked about. This is ok for me at this time... I'm looking forward for a fix. Thank you very much. BTW: Very nice project |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). The bug should be fixed in the last commit. Regards, |
Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann). You're right ;-) I tested the fix (thank you for the fast fix) and it works, but I still had to make a small source modification to get it work. I had to increase the time in WatcherWin32.cpp from 10ms to 100ms because I still got double notifications. Maybe this should be user configureable? |
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ). I think that i thought a bad solution with that fix. I've changed the way i filter this duplicate event. Now i compare the Modification Time of the modified file, if it's the same the the last reported modified event, the event is ignored. It's a little bit slower ( since i need to 'stat' the file ), but nothing problematic ( unless you are changing thousand of files per second in a slow HD ). If you have any problem, just let me know! But i think this is the correct solution. Regards, |
Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann). Works like a charm. Thank you very much. |
Original report by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann).
System: Windows 8.1
Compiler: Visual Studio 2012
Steps to reproduce:
No event is triggered. When creating a new file and modifying it after creation, everything works as expected.
The text was updated successfully, but these errors were encountered: