UNPKG

ftp-srv-esm

Version:

Modern, extensible FTP server (daemon) for Node.js with ESM support. Based on ftp-srv.

21 lines (19 loc) 601 B
export default { directive: 'RNFR', handler: function ({log, command} = {}) { if (!this.fs) return this.reply(550, 'File system not instantiated'); if (!this.fs.get) return this.reply(402, 'Not supported by file system'); const fileName = command.arg; return Promise.resolve().then(() => this.fs.get(fileName)) .then(() => { this.renameFrom = fileName; return this.reply(350); }) .catch((err) => { log.error(err); return this.reply(550, err.message); }); }, syntax: '{{cmd}} <name>', description: 'Rename from' };