mscdex / ssh2-streams

SSH2 and SFTP client/server protocol streams for node.js
MIT License
204 stars 143 forks source link

Posix rename support #152

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hi

Could you please add support for posix rename (posix-rename@openssh.com extension)? It would allow renaming a file even if a destination already exists in one operation and without any additional steps.

Thanks.

jhorbulyk commented 4 years ago

Unfortunately, even though this feature is defined in the latest SFTP RFC, it looks like this operation isn't supported in many SFTP implementations. As a result, many SFTP clients revert to an exist check, followed by a possible delete request, followed by a rename request. See Cyberduck for one such implementation.

mscdex commented 4 years ago

Support for the OpenSSH rename extension already exists via sftp.ext_openssh_rename().