node-klaw-sync icon indicating copy to clipboard operation
node-klaw-sync copied to clipboard

Exception thrown when directory contains broken symlink.

Open c0d3d opened this issue 4 years ago • 0 comments

Right now, the code uses statSync, but this attempts to read through symlinks, and will throw ENOENT for any broken symlinks.

IMO, this call should be lstatSync as it gives users more control (and also doesn't throw exceptions if the link is broken).

I found this will using a library that depends on klawSync, I wasn't aware that there was a broken symlink in the directory, but nonetheless I don't think the library should assume that users always want to read through symlinks. It would be better to let the user library break and they can deal with it accordingly.

c0d3d avatar Nov 09 '20 17:11 c0d3d