-
Notifications
You must be signed in to change notification settings - Fork 26
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
rmdir recursive not working correctly #13
Comments
Huh. Well I'm certainly not generating any German-language errors. :-) I'm guessing that text is from the FTP server, and the error is being generated by the I don't currently have an FTP server I can easily use for testing, but my guess off the top of my head is that it could be your server that doesn't support recursive delete, even though the Could you attempt a recursive rmdir via a CLI or GUI FTP client? Or alternatively, could you try using |
Since it is either hosted in Germany or Austria, it would make sense.
I don't think that's the case since it works on my
I tried deleting a folder with Cyberduck and it works without problems but I'm not sure how it does the deleting. Maybe it just goes through all subdirectories recursively and that's why it works.
I tried it on a different Server but I got the same Error. But I think that all FTP servers I have available are by the same host so this test probably doesn't help much. |
Ok, tell me if I have this right -- you can delete a directory with files in it, but not a directory with another directory in it? Aha, reading my own documentation more closely (which is mostly copied from the Since this library is 95% just providing a promise-based API that passes through to the underlying For now, I'll just change the documentation here to make the situation clear. |
Ok, thanks. That makes sense. Actually there is already an open issue on the |
Ok I just tried to reproduce my issue with Here's my const Client = require('ftp');
const ftpCredentials = require('./ftpCredentials');
const c = new Client();
c.on('ready', () => {
c.rmdir('test', true, (err) => {
if (err) throw err;
c.end();
});
});
c.connect(ftpCredentials)); |
Seems to work for me. const PromiseFtp = require('promise-ftp');
function testRecursiveDelete(credentials) {
try {
const ftp = new PromiseFtp();
// connect to the server
await ftp.connect(credentials);
// create folder with subdirectories
await ftp.mkdir('/foo/bar/baz', true);
// upload a file to the deepest subdirectory
await ftp.put('/path/to/my/file.txt', '/foo/bar/baz/file.txt');
// delete the main folder and its contents
await ftp.rmdir('/foo', true);
} catch (err) {
console.error(err);
}
} Would be nice, if anyone could double-check that. |
I have a directory that is nested like this:
Now if I try to do
I get the following error:
I'm not sure if the error message comes from your library or some dependency so just in case the translation for "Das Verzeichnis ist nicht leer" is "The directory isn't empty".
On my
js
directory that has no subdirectories it works without problems.The text was updated successfully, but these errors were encountered: