-
Notifications
You must be signed in to change notification settings - Fork 210
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
INotifyWatcher::watch returns an error if any subdirectories contain a broken link. #47
Comments
Ah, I'd have thought the immediate next part in the code (that ignores errors in the lookup) would have solved this. I think the simple thing would just be to completely ignore broken symlinks, at the WalkDir level at least. I'm idly wondering how this all behaves on other platforms that have symlinks (OS X)... does FSEvent just ignore broken symlinks itself? Hmm. |
INotifyWatcher::watch
returns an error if any subdirectories contain a broken link.
Maybe the best way to fix this is to remove the call to That would also allow |
@passcod if you have a preference for how to fix this, I'd be happy to work on a PR. |
Yep, your last proposition sounds good. If you want to work on it, even more awesome :) |
So..... I think I had this all wrong. The way that So actually everything is working? I think perhaps the original issue reported on my project may have been for a different OS than linux... Anyways, sorry for the non-bug. |
No problem, thanks for investigating! |
This came up on my project: maurizi/retag.rs#23
From what I can tell, because
follow_links(true)
is called here,WalkDir
returns the target path of symlinks, even if they are broken links. Then when we pass the path over toinotify
, it correctly returns an error.@passcod I can think of a couple of ways to fix this.
WalkDir
could be tested to see that it exists before callingadd_watch
add_watch
when calling it fromadd_watch_recursively
add_watch
when calling it fromadd_watch_recursively
What do you think?
The text was updated successfully, but these errors were encountered: