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

fs.rmdir throws EBUSY on Windows, nothing on Unix #3017

Closed
arturadib opened this issue Mar 27, 2012 · 2 comments
Closed

fs.rmdir throws EBUSY on Windows, nothing on Unix #3017

arturadib opened this issue Mar 27, 2012 · 2 comments

Comments

@arturadib
Copy link

If you run on the command line:

$ mkdir test
$ cd test
$ node \path_to_script\script.js

where script.js is:

var fs = require('fs'),
    path = require('path'),
    originalDir = path.resolve('.');

process.chdir('..');
fs.rmdirSync(originalDir);

the script throws EBUSY on Windows. On Unix, the directory is deleted without throwing an exception.

This is another cross-platform difference (see #3006) that I'm not sure can/should be normalized by Node or libuv, but I figured I'd report it anyway :)

@bnoordhuis
Copy link
Member

/cc @piscisaureus

@piscisaureus
Copy link

Can't be fixed. The cygwin guys have tried this for years.

As a more general note, there are some issues with removing files and directories that we will address. But deleting files that are in use is something that you are not supposed to do on windows, and we won't add crazy hacks to make it possible.

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