Back to product page

Rename method


Renames file or directory on the server.

Type

None

Syntax

  • Basic
object.Rename NewRemotePath, [OldRemotePath]
The Rename(object,NewRemotePath,OldRemotePath) syntax has these parts:
objectAn expression evaluating to an object of type wodFtpDLX.
NewRemotePathRequired. A String value. Full path to new file/directory name.
OldRemotePathOptional. A Variant value. Full path to old file/directory name.

Remarks

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

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

Even UNIX (and windows in last few versions) have same command for renaming and moving (which is in fact MOVE command), you cannot be sure that this command will also move files from one directory to another. This depends only on server-side implementation of FTP and SFTP protocols.

No wildcards can be used for RemotePath argument. RFC protocol specifications for FTP and FTP do not allow them.

Platforms

Windows