-
Notifications
You must be signed in to change notification settings - Fork 130
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
Recursive events not triggering from root drive on Windows #148
Comments
After digging through some internals, I figured it out. Pro tip: to watch a full drive, the watch path should be in the form |
@lsegal Actually it is a bug in this case. However unusual, to watch the whole drive, it should be working. Thanks for debugging this! |
@lsegal Thanks for reporting this. It definitely looks like a bug since there shouldn't be any difference between watching root directory and any other path. |
Not sure what happened on this since my last tests but it seems like the I should point out that it may seem odd to watch a full drive like |
FYI I was doing some more digging on this and found debug logging, which is great. I've managed to reproduce a potential issue with the following minimal case: package main
import (
"fmt"
"github.com/rjeczalik/notify"
)
func main() {
ch := make(chan notify.EventInfo)
err := notify.Watch(`D:...`, ch, notify.All)
if err != nil {
panic(err)
}
for {
fmt.Println(<-ch)
}
} If I then
Digging further, it seems like the error is returned from node.go#L222 because
I'd expect to see other root folders in that list. |
Another update: I've also noticed that this same behavioral bug is present on macOS, so it seems like related to the recursive watcher not correctly initializing |
Thank you @lsegal for this thoughtful investigation! Indeed, this isn't a problem with Windows watcher itself. |
If
notify.Watch()
is called on the root of a drive on Windows using recursive syntax ("..."), events don't seem to trigger.Minimal repro using a slightly modified version of the Recursive example in docs:
Trying to watch for events on
C:\
doesn't seem to fire when changes are made inside my user dir. Only changes directly inC:\
trigger. On the other hand, if I use the commented out HOMEPATH version, I see changes in subdirectories (like Chrome touching files in AppData, for example).If this is intended behavior or some known limitation, are there any workarounds for this?
The text was updated successfully, but these errors were encountered: