-
Notifications
You must be signed in to change notification settings - Fork 128
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
Missing events: Not getting any event for the recreated directory #190
Comments
Could you please share some reproducer? Go snippet to show how you set watches and some example bash commands how you create temp dir and do all these operations. It would be greatly helpful. |
`func main() { func WatchFS(rootDir string) { func setupWatch(path string, events chan notify.EventInfo) error { func handleFSEventsInfinite(events chan notify.EventInfo) { |
Below is the shell script which I used to run the commands: |
Output of the above script: |
As you can see, there is no event generated for file /home/mydir/tmp/b.txt |
I checked this package: https://github.com/fsnotify/fsnotify and it seems to be working fine even when the directory with the same name is recreated. |
@vivek-bansal-VB Thanks for the repro! Since I don't have access to macOS nowadays, someone else would need to troubleshoot it. Out of curiosity, does it reproduce when you build with kqueue instead of FSEvents? |
@rjeczalik Yes I tried with -tags kqueue and the same issue is there as well. |
Other solution for this problem can be: If there would be a function: RemoveWatch(path) exposed by the library. So before deleting the directory I will remove the watch from that directory, and later on when the same directory will be created again, AddWatch(path) method will work on that correctly. Currently AddWatch(path) method is not working correctly since I didn't remove the watch from the directory as there is no method exposed to remove the watch. |
Might also be fixed by #201 - could you test if it actually is please? @vivek-bansal-VB |
I have set a watch on directory /home/mydir and created a subdirectory (tmp) under it. I dropped some files in directory /home/mydir/tmp and I got the file create events. Then I deleted the directory (/home/mydir/tmp) and recreated it. Again I dropped some files in the directory (/home/mydir/tmp), but this time I am not getting any events in this directory. Seems a probable bug. Any help is much appreciated.
The text was updated successfully, but these errors were encountered: