RemoveFTPDirectory Method
Class: FTP_SERVICE
Description:Removes a directory on the FTP Server
Removes a directory on the FTP Server.
Note
Probably, if the directory is not empty, the FTP Server will not remove the directory.
=
Object.RemoveFTPDirectory
(lcDir)
Parameter
lcDir
Directory
Type Character
Direction Input
Name of the directory to remove on the FTP Server.
Return value Boolean
Returns .T. if the function successfully removed the directory on the FTP Server. Returns .F. if the function could not remove the directory on the server.
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.RemoveFTPDirectory("newfolder") ?loFTP.GetExtendedErrorCode(),loFTP.GetExtendedErrorMsg() ENDIF =loFTP.CloseInternet() ENDIF RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure RemoveFTPDirectory Source Code
      LPARAMETERS INP lcDir
      LOCAL fResult
      IF This.OpenFTPConnection(This.cCurrentDir)     && Open an FTP Handle                   
         lcDir = m.lcDir + cNULL
                                                    
         =This.BeforeRemoveFTPDirectory(@m.lcDir)
         fResult = FtpRemoveDirectory(This.nConnect_Handle, @m.lcDir)
         =This.GetExtendedError()
         =This.AfterRemoveFTPDirectory(@m.lcDir,m.fResult)
         =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection())   && Close FTP Handle
                   
         RETURN m.fResult = 1
      ENDIF
      RETURN .F.