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

access failing under 5.5.0 #79

Closed
cxreg opened this issue Jan 31, 2016 · 4 comments
Closed

access failing under 5.5.0 #79

cxreg opened this issue Jan 31, 2016 · 4 comments

Comments

@cxreg
Copy link

cxreg commented Jan 31, 2016

I feel like I must be doing something wrong, but I can't figure out what is happening here

I've golfed it down to this:

$ node -e 'require("mock-fs")({}); require("fs").access("foo",function(){});'
node_modules/mock-fs/node/fs-5.0.0.js:196
binding.access(pathModule._makeLong(path), mode, req);
^

TypeError: binding.access is not a function
at Object.fs.access (/home/dolszewski/mx/voice/dropcamel/node_modules/mock-fs/node/fs-5.0.0.js:196:11)
at [eval]:1:39
at Object.exports.runInThisContext (vm.js:54:17)
at Object. ([eval]-wrapper:6:22)
at Module._compile (module.js:413:34)
at node.js:611:27
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)

any ideas?

@cxreg
Copy link
Author

cxreg commented Jan 31, 2016

This seems to be stemming from the fact that lib/binding.js simply does not have Binding.prototype.access at all. I'm not sure how this ever worked. Maybe it didn't?

I ran into this porting my calls of fs.exists to fs.access, which could explain why it's a new issue for me.

I hacked together a quick proof of concept using Binding.prototype.stat and it worked, so this does seem to be the problem.

@tschaub
Copy link
Owner

tschaub commented Jan 31, 2016

What version of Node are you running?

It looks like this would be fixed with #78 - though I'd like to see tests for the fs functions where this is needed.

@tschaub
Copy link
Owner

tschaub commented Jan 31, 2016

What version of Node are you running?

I see 5.5.5 in the title.

@tschaub
Copy link
Owner

tschaub commented Jan 31, 2016

@cxreg [email protected] has support for fs.access() and fs.accessSync(). See #79 for what is covered by the tests. I'm uncertain how fs.access() works on Windows (without uid/gid) - so the behavior should not be trusted there for now. Any Windows expertise is welcome.

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