Skip to content

rmdir (recursive) fails with unicode chacaters #276

@rioki

Description

@rioki

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions