Closed fishcatcher closed 2 years ago
@fishcatcher Hi, thanks for reporting it, I'll take a look later. I'm curious on why are you using the generic watcher? It's there more like an example of a watcher implementation than something that can be used in production environments, its performance will be really poor in comparison with the specific OS implementation of the watcher.
We're using the generic implementation to watch a network drive.
I'm unable to reproduce it. Can you provider a minimal code example to reproduce it? Thanks.
Hi, It's just this simple code:
int main()
{
std::cout << "Hello World!\n";
/// create the file watcher object
efsw::FileWatcher fileWatcher(true);
/// starts watching
fileWatcher.watch();
efsw::System::sleep(1000);
UpdateListener* ul = new UpdateListener();
efsw::WatchID id = fileWatcher.addWatch("C:\\Users\\Frog\\Desktop\\TestWatchFolder", ul, true);
handleWatchID(id);
while (true)
{
efsw::System::sleep(100);
}
return 0;
}
Additional info: If TestWatchFolder
is empty before you run the watch, it works, all changes are detected no matter how nested. But if the TestWatchFolder
already has nested folders, i.e. C:\Users\Frog\Desktop\TestWatchFolder\B\C\D\E\F\G\H\E
then it won't detect changes like reported.
I pushed some fixes for the issue. Let me know if it's working for you.
I pushed some fixes for the issue. Let me know if it's working for you.
That fixes it, thank you!
Hi, I have the following structure: A: --\B: ----\C: ------\CC:
If I watch "A\B" which recursive is set to true, the followings happen: 1) Every change in B is detected (correct behavior) 2) In "C", only file (add/remove) is detected, folder change (add/remove) is NOT detected 3) In "CC", neither file or folder change is detected (For 2 and 3, the working folder is reported as modified) 4) If you go 3 levels deep from the watched folder, none of the action is reported (including the working directory being reported as modified )