Rename

Declaration: TFtpConnection.Rename (SrcFile, DstFile: string): integer;
The method Rename moves the file SrcFile on the FTP server to the path DstFile. Please note that you can use either absolute or relative pathes. If path information is not found in the argument values, the current directory on the remote file system is assumed. If a file named DstFile already exists on the server the file DstFile will be overwritten by SrcFile without any warning.

The function returns the following error codes:

 0 ... everything is OK
-2 ... source file not found
-3 ... cannot read file (access error)
-9 ... unspecified error

Hint: Most FTP servers are Unix-based. Thus the pathes to the files SrcFile and DstFile normally uses slashes (/) instead of backslashes (\) to separate directories. Failing to use the correct separation character will result in an error (-2).