wodSFTP ActiveX Control - Rename Method
      
 

Description

Renames a file or directory on the server.


Return Type

None  


Syntax

object.Rename NewRemotePath, [OldRemotePath]



The Rename Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodSFTP.
NewRemotePath Required. A String value. Full path to a new file/directory on the server.
OldRemotePath Optional. A Variant value. Full path to a file/directory on the server.

Remarks

This method will rename a file or directory on the remote server, if possible. Once completed, the Done event will be fired. If no error occurs, the ErrorCode argument in the Done event will be set to 0 (zero). If an error occurs, ErrorCode will hold the number of the error and ErrorText will contain a description for the error.

If you don't specify the OldRemotePath argument, then wodSFTP will use the value of the RemotePath property for this method.

Even though UNIX (and recent versions of Windows) has the same commands for renaming and moving (i.e. the MOVE command), you cannot be sure that this command will also move files from one directory to another. This depends on the server-side implementation of the SFTP protocol.

No wildcards can be used for the NewRemotePath or OldRemotePath arguments. The RFC protocol specification for SFTP does not allow them.