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

fs: unlink() on a locked file works but rmdir() on parent does not #7175

Closed
bpasero opened this issue Feb 23, 2014 · 2 comments
Closed

fs: unlink() on a locked file works but rmdir() on parent does not #7175

bpasero opened this issue Feb 23, 2014 · 2 comments

Comments

@bpasero
Copy link

bpasero commented Feb 23, 2014

On Windows, when a file is locked by another process, you can still unlink() this file from another node process and the operation will not fail. The reason has been explained in good detail in #7164.

However, I would expect that I can rmdir() the parent folder of this locked file in the same way I can unlink() the file. When I try to rmdir() the folder, I get a EPERM - directory is not empty error.

I think the unlink() should fail in the first place if the file is used by another process or I should be able to rmdir() the parent folder. As a user that was able to unlink() the file, I would not expect the rmdir() to fail.

@trevnorris
Copy link

@piscisaureus Windows magic?

@piscisaureus
Copy link

This isn't fixable. See #3051 (comment)

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