RenameFTPFile Method
Class: FTP_SERVICE
Pretty simple, just renames a file.
=
Object.RenameFTPFile
Parameter
lcOldFile
Old file name
Type Character
Direction Input
Current file name on FTP Server.
lcNewFile
New file name
Type Character
Direction Input
New name for file on FTP Server.
Return value Boolean
Returns .T. if the function successfully renamed the file on the FTP Server. Returns .F. if the function could not rename the file.
Example
LOCAL loFTP,lcPom
#INCLUDE "ftp.h"
SET PROCEDURE TO ftp.prg ADDITIVE 
loFTP=CREATEOBJECT('ftp_service') 

IF loFTP.OpenInternet("ABONNE", "PWD", "10.10.10.10", "21")
   IF !loFTP.RenameFTPFile("any.txt","any2.txt")
      ?loFTP.GetExtendedErrorCode(),loFTP.GetExtendedErrorMsg()
   ENDIF
   =loFTP.CloseInternet() 
ENDIF
RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure RenameFTPFile Source Code
      LPARAMETERS INP lcOldFile,INP lcNewFile
      LOCAL fResult
      IF This.OpenFTPConnection(This.cStartupFolder)     && Open an FTP Handle
         lcOldFile = lcOldFile + cNULL
         lcNewFile = lcNewFile + cNULL

         =This.BeforeRenameFTPFile(@lcOldFile, @lcNewFile)
         fResult = FtpRenameFile(This.nConnect_Handle, @lcOldFile, @lcNewFile)
         =This.GetExtendedError()
         =This.AfterRenameFTPFile(@lcOldFile, @lcNewFile,fResult)
         =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection())   && Close FTP Handle
         RETURN fResult = 1
      ENDIF
      RETURN .F.