Skip to content
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) fails with unicode chacaters #276

Open
rioki opened this issue May 20, 2021 · 1 comment
Open

rmdir (recursive) fails with unicode chacaters #276

rioki opened this issue May 20, 2021 · 1 comment

Comments

@rioki
Copy link

rioki commented May 20, 2021

I wrote a small maintenance script with the following code:

function deleteArtifact(path, cb) {
  const ftp = new FtpClient();
  ftp.on('ready', function() {
    ftp.rmdir(path, true, (err) => {
      cb(err);
      ftp.end();
    });
    
  });
  ftp.on('error', cb);
  ftp.connect({host: ARTIFACT_HOSTNAME, user: ARTIFACT_FTP_USER, password: ARTIFACT_FTP_PASS});
}

Now because of failures in other systems we have a test directory called "スーパーテストディレクトリ". So when trying to delete "Models\スーパーテストディレクトリ" it failes with

Error: [...]/Models/⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂: No such file or directory.
    at makeError ([...]\node_modules\ftp\lib\connection.js:1067:13)
    at Parser.<anonymous> ([...]\node_modules\ftp\lib\connection.js:113:25)
    at Parser.emit (node:events:369:20)
    at Parser._write ([...]\node_modules\ftp\lib\parser.js:59:10)
    at writeOrBuffer (node:internal/streams/writable:395:12)
    at Parser.Writable.write (node:internal/streams/writable:340:10)
    at Socket.ondata ([...]\node_modules\ftp\lib\connection.js:273:20)
    at Socket.emit (node:events:369:20)
    at addChunk (node:internal/streams/readable:313:12)
    at readableAddChunk (node:internal/streams/readable:288:9) {
  code: 550
}

Is there anyway to make node-ftp understand unicode or can this be a FTP server config issue?

@4lirexa
Copy link

4lirexa commented May 28, 2023

I wrote a small maintenance script with the following code:

function deleteArtifact(path, cb) {
  const ftp = new FtpClient();
  ftp.on('ready', function() {
    ftp.rmdir(path, true, (err) => {
      cb(err);
      ftp.end();
    });
    
  });
  ftp.on('error', cb);
  ftp.connect({host: ARTIFACT_HOSTNAME, user: ARTIFACT_FTP_USER, password: ARTIFACT_FTP_PASS});
}

Now because of failures in other systems we have a test directory called "スーパーテストディレクトリ". So when trying to delete "Models\スーパーテストディレクトリ" it failes with

Error: [...]/Models/⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂⌂: No such file or directory.
    at makeError ([...]\node_modules\ftp\lib\connection.js:1067:13)
    at Parser.<anonymous> ([...]\node_modules\ftp\lib\connection.js:113:25)
    at Parser.emit (node:events:369:20)
    at Parser._write ([...]\node_modules\ftp\lib\parser.js:59:10)
    at writeOrBuffer (node:internal/streams/writable:395:12)
    at Parser.Writable.write (node:internal/streams/writable:340:10)
    at Socket.ondata ([...]\node_modules\ftp\lib\connection.js:273:20)
    at Socket.emit (node:events:369:20)
    at addChunk (node:internal/streams/readable:313:12)
    at readableAddChunk (node:internal/streams/readable:288:9) {
  code: 550
}

Is there anyway to make node-ftp understand unicode or can this be a FTP server config issue?

try this https://www.npmjs.com/package/@icetee/ftp

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

No branches or pull requests

2 participants