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

fs.accessSync() with W_OK throws EPERM for directories in Windows #1397

Closed
gromnitsky opened this issue Apr 11, 2015 · 5 comments · Fixed by libuv/libuv#316
Closed

fs.accessSync() with W_OK throws EPERM for directories in Windows #1397

gromnitsky opened this issue Apr 11, 2015 · 5 comments · Fixed by libuv/libuv#316
Labels
fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform.

Comments

@gromnitsky
Copy link
Contributor

iojs 1.6.4 x86 under Windows 8.1 64 bit

> fs.accessSync(os.tmpDir(), fs.W_OK)
Error: EPERM: operation not permitted, access 'C:\Users\alex\AppData\Local\Temp'

The same check for a directory works fine in Linux:

> fs.accessSync(os.tmpDir(), fs.W_OK)
undefined
@Fishrock123 Fishrock123 added fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform. labels Apr 11, 2015
@cjihrig
Copy link
Contributor

cjihrig commented Apr 11, 2015

This is the source of the problem: https://github.com/libuv/libuv/blob/v1.x/src/win/fs.c#L1315

@saghul in nodejs/node-v0.x-archive#8418 (comment), you said using the FILE_ATTRIBUTE_DIRECTORY was adapted from CPython. Do you (or a Windows person) know if that is strictly necessary?

cc: @piscisaureus

@saghul
Copy link
Member

saghul commented Apr 11, 2015

Hum, it might not. I'll double check.

@saghul
Copy link
Member

saghul commented Apr 12, 2015

@cjihrig should be fixed in libuv/libuv#316

@cjihrig
Copy link
Contributor

cjihrig commented Apr 13, 2015

Thanks @saghul!

bnoordhuis pushed a commit that referenced this issue May 6, 2015
Fixes: #1397
Fixes: #1512
Fixes: #1621
Fixes: #862
PR-URL: #1646
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
@bnoordhuis
Copy link
Member

Should be fixed by 04cc03b. Closing, holler if I should reopen it.

Fishrock123 pushed a commit to Fishrock123/node that referenced this issue May 19, 2015
Fixes: nodejs#1397
Fixes: nodejs#1512
Fixes: nodejs#1621
Fixes: nodejs#862
PR-URL: nodejs#1646
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants