Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

fs.unlink('not_empty_directory', ...) on Windows raises EPERM instead of EISDIR #5791

Closed
mdesantis opened this issue Jul 4, 2013 · 3 comments

Comments

@mdesantis
Copy link

node 0.10.12, Windows 7 64bit

The code:

fs = require('fs');
fs.unlink('./not_empty_directory', function(err) { if(err) throw err });

raises a EPERM error. The documentation says its behaviour is like unlink(2), so I expect it to raise a EISIDIR error.

If on Windows the behaviour is different from Linux/Unix unlink(2) maybe it should be pointed out on the documentation.

@isaacs
Copy link

isaacs commented Jul 6, 2013

@bnoordhuis @piscisaureus I'm inclined to think that libuv should raise an EISDIR here, but I'd be ok with a doc "fix" if that's too tricky to do. What do you think?

@chrisdickinson
Copy link

Per @bnoordhuis in IRC:

<chrisdickinson> bnoordhuis: recently checked out this issue (https://github.com/joyent/node/issues/5791) -- fs raising EPERM on unlink(directory) -- 
seems to still be an issue on osx/windows. do you think it's worth fixing that in libuv, or just doing a doc update?
<bnoordhuis> chrisdickinson: doc update. libuv just passes on the os error

@chrisdickinson
Copy link

This should be included in the error documentation PR. Making a note of it there and closing this issue.

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

No branches or pull requests

3 participants