SpartanJ / efsw

efsw is a C++ cross-platform file system watcher and notifier.
Other
662 stars 101 forks source link

Last modified file remembered and failing to fire event under Windows #159

Closed xXTurnerLP closed 1 year ago

xXTurnerLP commented 1 year ago

In windows (using the platform specific listener) when a file (lets call it file A) is changed and later changed again it will not fire an event, however if you change another file (lets call it file B) and after that change file A it will fire an event.

It seems the last modified file is "remembered"

Here are a couple scenarios: edit file A -> fire event edit file A -> nothing edit file A -> nothing

edit file A -> fire event edit file B -> fire event edit file A -> fire event edit file B -> fire event

edit file A -> fire event edit file B -> fire event edit file A -> fire event edit file A -> nothing edit file B -> fire event edit file B -> nothing

xXTurnerLP commented 1 year ago

Issue is you need a trailing slash \

SpartanJ commented 1 year ago

Hi, this sounds similar to something that I fixed or tried to fix very recently regarding the trailing slash, see commit and commit. You are using the latest version? Can you tell me where do you see that a trailing slash is missing?

SpartanJ commented 1 year ago

I'm unable to reproduce it. How are you editing the file?

xXTurnerLP commented 1 year ago

Im editing the file via normal notepad and im extending a class with FileWatchListener

EDIT: Also i was using directory as the current dir ie. . and only . did not work, however .\ worked

SpartanJ commented 1 year ago

It should be fixed, it only could happen with . as a parameter given an incorrect check when adding automatically the \. Thanks for reporting it.