FTPRename

Command group Flag affected Reversible Execute on client Platform(s)
External commands YES NO NO All

Syntax

FTPRename (socket,oldname,newnameReturns status

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This Web command is multi-threaded, allowing another thread to execute in the multi-threaded server while it runs. Note that the same socket cannot safely be used concurrently by more than one thread.

FTPRename renames a remote file.

Socket is an Omnis Long Integer field containing a socket opened to an FTP server using FTPConnect.

OldName is an Omnis Character field containing the pathname of the file to rename.

NewName is an Omnis Character field containing the new pathname for the file

Status is an Omnis Long Integer field which receives the result of executing the command. Possible error codes are listed in the Web Command Error Codes Appendix.

Note: Local filename conventions may not be acceptable to the remote system.

Example

; rename a file or folder in the current working directory
FTPRename (iFTPSocket,lFileName,lNewFileName) Returns lErrCode
If lErrCode
  FTPGetLastStatus (iServerReplyText) Returns lErrCode
  OK message FTP Error {[con("Error renaming ",lFileName," to ",lNewFileName,kCr,"Details follow:",kCr,iServerReplyText)]}
End If