RenameFile Method

Changes the name of a file on the remote server using SFTP.

Syntax

public string RenameFile(string newName);
Public Function RenameFile(ByVal NewName As String) As String

Remarks

This method renames the file on the server specified by RemoteFile to the name specified by the NewName parameter. RemoteFile and NewName are either absolute paths on the server, or a path relative to RemotePath.

This method returns an Operation Id which identifies the operation in progress. A corresponding SSHPlexOperation will also be added to the Operations collection. The operation can be canceled by passing the Operation Id to the CancelOperation method.

When the operation completes the RenameFileComplete event will fire, and the SSHPlexOperation associated with the completed operation will be removed from the Operations collection. Inspect the parameters of the RenameFileComplete event to determine the result.

If there is no SSH session in place, one is automatically created by the component first.

This method is only applicable when ChannelType is set to cstSftp.

Copyright (c) 2023 /n software inc. - All rights reserved.
IPWorks SSH 2020 .NET Edition - Version 20.0 [Build 8501]