Archived Forum Post

Index of archived forum posts

Question:

SFTP Move File Command?

Jun 27 '12 at 19:17

I'm evaluating your component to be used in a project, there is only one requirement that I did not figure out how to address using SFTP class. After downloading a file I need to move the to a different directory, looks like the SFTP server support a move command (MV), so my questions are:

I do not want to upload the file back in a different folder and delete original file.


Answer

In SFTP, the "rename" operation is synonymous (i.e. means the exact same thing) as "move" file. The Chilkat SFTP method to move/rename a file is RenameFileOrDir. The reason "rename" was chosen is because the SFTP protocol specification uses the term "rename".

You can see the SFTP v6 protocol specification here: http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13

The section of the SFTP protocol spec that concerns renaming is on page 38: http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#page-38