ryanmcgrath / wrench-js

Recursive file operations in Node.js
MIT License
435 stars 71 forks source link

Error when deleting with rmdirSync #34

Closed Philipp15b closed 12 years ago

Philipp15b commented 12 years ago

When I delete a folder with some subfolders and files in it, the contents of the folder are deleted, but the program aborts with an error message saying the folder is not empty.

I'm using Windows 64bit with Node.js 0.8.7.

ryanmcgrath commented 12 years ago

Mmm, I'm closing this as I couldn't reproduce it on my Windows VM, so I'm gonna guess it's been fixed recently...? If someone proves me wrong I'm totally fine with this being re-opened.

0xjac commented 11 years ago

I'm sorry to say that I have the same error. Here is what happens in my case.
I have the following structure

when I do

wrench.rmdirRecursive('To_delete', function(err) {
    if(err) throw err;
    console.log('folder deleted.');
});

I get the following:

Error: ENOTEMPTY, rmdir 'To_delete'

When I look, the folder To_delete is still present but some of it's content is gone, for example the file index.html and the folder img are gone.

I have no idea exactly why this is happening. My guess is, it might screw things up to delete a folder containing sub-folders...

I am using the following:

Let me know if you need m to provide more information about this.