-
Notifications
You must be signed in to change notification settings - Fork 87
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
Ignore file if fs.stat returns an error #35
Conversation
Just ran into this issue. Would appreciate this merge. |
But I think that is not a solution for this issue: |
@OlafRadicke Did you try? I think this change should also resolve your issue. |
@josiasmontag I tested with my own script -> https://github.com/OlafRadicke/aguano |
@jergason Why this commit is not merged into master ? I've the same issue with broken links. |
Can you help me understand what the issue with broken symbolic links is? If you call If that is the case, I could see a case for handling that case specifically, but this feels like too broad of a change for that. |
Yes, exactly. In my case, if there is broken links, I want not break the recursion and return all others files. |
Please merge |
To make it possible to detect symlinks using isSymbolicLink
I'm happy to revisit this if you handle the objection I specified: continuing on only ENOENT. I'm closing this PR but feel free to open another one handling that case specifically. |
Currently, if
fs.stat
fails for one specific file, the completerecursive-readdir
operation is aborted with an error.I think we should change this behavior and just ignore the specific failing file instead of letting
recursive-readdir
completely fail.Background:
In my case it is happening sometimes that a file is deleted in the time between the
fs.readdir
and thefs.stat
operation ofrecursive-readdir
. In this casefs.stat
fails withENOENT
and makesrecursive-readdir
completely fail.