Giter Club home page Giter Club logo

Comments (8)

SpartanJ avatar SpartanJ commented on August 29, 2024

Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann).


The modification is recognized when file size changed only.

from efsw.

SpartanJ avatar SpartanJ commented on August 29, 2024

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.

SpartanJ avatar SpartanJ commented on August 29, 2024

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.

SpartanJ avatar SpartanJ commented on August 29, 2024

Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).


Fixed issue #14. Thanks Roland Rosenkranz for reporting it!

from efsw.

SpartanJ avatar SpartanJ commented on August 29, 2024

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.

SpartanJ avatar SpartanJ commented on August 29, 2024

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.

SpartanJ avatar SpartanJ commented on August 29, 2024

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.

SpartanJ avatar SpartanJ commented on August 29, 2024

Original comment by Roland Rosenkranz (Bitbucket: Glatzemann, GitHub: Glatzemann).


Works like a charm. Thank you very much.

from efsw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.