paulmillr / chokidar

Minimal and efficient cross-platform file watching library
https://paulmillr.com
MIT License
10.8k stars 574 forks source link

stat fails on invalid symbolic link - should use lstat #1287

Closed BobFrankston closed 2 months ago

BobFrankston commented 1 year ago

the stat function fails on an invalid symbolic link -- one for which the target is unavailable. lstat can be used to get the link's status without following it, thus avoiding the error. For watching there shouldn't be a need to follow links. I see the code tries both stat and lstat -- the failure of stat should not be fatal.