This function places the current directory on the FTP Server into the Directory Variable that was passed by reference to this function.
Parameter
-
lcDirectory
-
Remote directory
Type |
Character |
By reference |
|
Direction |
Output |
A pointer to a variable to hold the FTP Server directory.
Returns .T.
if the function successfully returned the current directory on the FTP Server.
Returns .F.
if the function could get the current directory.
Source Code
LPARAMETERS 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.