GetFTPDirectory Method
Class: FTP_SERVICE
This method places the current directory on the FTP Server into the Directory Variable that was passed by reference to this method.
=
Object.GetFTPDirectory
Parameter
lcDirectory
Remote directory
Type Character
By reference  
Direction Output
A pointer to a variable to hold the FTP Server directory.
Return value Boolean
Returns .T. if the function successfully returned the current directory on the FTP Server. Returns .F. if the function could get the current directory.
Example
LOCAL loFTP,lcPom,lcFolder
#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.GetFTPDirectory(@lcFolder)
      ?loFTP.GetExtendedErrorCode(),loFTP.GetExtendedErrorMsg()
   ELSE
      ?lcFolder
   ENDIF
   =loFTP.CloseInternet() 
ENDIF
RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure GetFTPDirectory Source Code
      LPARAMETERS OUTREF lcDirectory
      LOCAL fResult, lcTempDir
      IF This.OpenFTPConnection(This.cStartupFolder)     && Open an FTP Handle
         lcTempDir = SPACE(MAX_PATH)
         =This.BeforeGetFTPDirectory(@lcDirectory)
         fResult = FtpGetCurrentDirectory(This.nConnect_Handle, @lcTempDir, MAX_PATH)
         =This.GetExtendedError()
         lcDirectory = LEFT(lcTempDir, AT(cNULL, lcTempDir) - 1)
         =This.AfterGetFTPDirectory(@lcDirectory,fResult)
         =IIF(This.lMultiOperations,.T.,This.CloseFTPConnection())   && Close FTP Handle
         RETURN fResult = 1
      ENDIF
      RETURN .F.