Skip to content
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

chownr calling readdir on network-share file causes ENOTSUP, but isn't handled correctly #5

Closed
rocketmonkeys opened this issue Dec 14, 2015 · 2 comments

Comments

@rocketmonkeys
Copy link
Contributor

Same problem as this:
isaacs/node-glob#205

But in chrownr (https://github.com/isaacs/chownr/blob/master/chownr.js#L11), we have:

fs.readdir(p, function (er, children) {
    // any error other than ENOTDIR means it's not readable, or
    // doesn't exist.    give up.
    if (er && er.code !== "ENOTDIR") return cb(er)

When readdir()'ing a local file, we get ENOTDIR (good). Same thing on a network path gives ENOTSUP (weird).

We need to support ENOTSUP as well. Simple fix should be:

fs.readdir(p, function (er, children) {
    // any error other than ENOTDIR/ENOTSUP means it's not readable, or
    // doesn't exist.    give up.
    if (er && er.code !== "ENOTDIR" && er.code !== "ENOTSUP") return cb(er)

I'll make a small PR for this.

@isaacs
Copy link
Owner

isaacs commented Jan 4, 2019

fixed on 03eb97e

@isaacs isaacs closed this as completed Jan 4, 2019
@rocketmonkeys
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants