Comments (8)
Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann).
The modification is recognized when file size changed only.
from efsw.
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.
from efsw.
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
from efsw.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Fixed issue #14. Thanks Roland Rosenkranz for reporting it!
from efsw.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
The bug should be fixed in the last commit.
I wanted to clarify a thing: if you use FILE_NOTIFY_CHANGE_LAST_ACCESS , you will have a Modified event every time you open the file, and that's not the correct behavior. So i only used FILE_NOTIFY_CHANGE_LAST_WRITE for the fix.
Regards,
Martín
from efsw.
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?
from efsw.
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,
Martín
from efsw.
Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann).
Works like a charm. Thank you very much.
from efsw.
Related Issues (20)
- Generic watcher fails to watch sub-sub directories HOT 6
- Filename passed without extension HOT 1
- Cannot track symlinked file in Linux HOT 10
- Bazel Building HOT 1
- On MacOS, actions happening shortly after starting watcher are not reported HOT 19
- CMake multi config issue HOT 2
- Support Windows long path aware HOT 4
- Check Return Code and Allow Buffer Customization in `ReadDirectoryChangesW()` Function HOT 1
- Paranoid exit code? HOT 2
- MacOS build on server HOT 1
- [Bug] Crash while thread running after FileWatcherInotfiy destructed. HOT 16
- Premake5 macosx after gmake2 ... [CI Server] HOT 1
- Last modified file remembered and failing to fire event under Windows HOT 5
- Premake links in ReadMe is dead HOT 1
- FSEventStreamScheduleWithRunLoop has been deprecated in MacOS 13 HOT 3
- Nested template syntax breaks LEGACY builds HOT 3
- Generic file watcher doesn't report new directories on network drives HOT 2
- memory leak doubt and thread conflict HOT 2
- Cross building on macOS may cause `EFSW_FSEVENTS_NOT_SUPPORTED` incorrectly defined HOT 2
- Incorrect move events reported for simultaneous file moves across monitored subdirectories on Windows HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from efsw.