Skip to content

ENOENT "no such file or directory" when encountering a symlink that is invalid #6

@tennox

Description

@tennox

I got this error while traversing a directory:

Uncaught (in promise) Error: ENOENT: no such file or directory, stat '/home/manu/Apps/firefox/Link to firefox'
    at fs.statSync (fs.js:960)
    at Object.fs.statSync (ELECTRON_ASAR.js:279)
    at /home/manu/Documents/electron-app/node_modules/diveSync/diveSync.js:39
    at Array.some (<anonymous>)
    at diveSync (/home/manu/Documents/electron-app/node_modules/diveSync/diveSync.js:33)
    at /home/manu/Documents/electron-app/node_modules/diveSync/diveSync.js:50
    at Array.some (<anonymous>)

The file mentioned above is a symlink, pointing to a file that does not exist.

The error is valid - but if I use diveSync, I don't want it to choke on an invalid symlink but just ignore it.
Could you adapt diveSync handle that edge case?

Or do I have to use dive for that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions