Tries to change the current directory on the FTP Server to the path specified.
=
Object.ChangeFtpDirectory
Parameter
-
lcNewDir
-
New remote directory
Type |
Character |
Direction |
Input |
Name of the Path to change the current directory to.
Returns .T.
if the function successfully changed the current directory on the FTP Server.
Returns .F.
if the function could not change the directory.
Source Code
LPARAMETERS lcNewDir
LOCAL fResult, lcTempDir, llResult
IF This.OpenFtpConnection(This.cStartupFolder) && Open an FTP Handle
llResult = .F.
lcNewDir = lcNewDir + cNULL
lcTempDir = SPACE(MAX_PATH)
=This.BeforeChangeFtpDirectory(lcNewDir)
fResult = FtpSetCurrentDirectory(This.nConnect_Handle, @lcNewDir)
=This.GetExtendedError()
IF fResult = 1
fResult = FtpGetCurrentDirectory(This.nConnect_Handle, @lcTempDir, MAX_PATH)
=This.GetExtendedError()
IF fResult = 1
This.cCurrentDir = lcTempDir
llResult = .T.
ENDIF
ENDIF
=This.AfterChangeFtpDirectory(lcNewDir,fResult)
=IIF(This.lMultiOperations,.T.,This.CloseFtpConnection()) && Close FTP Handle
RETURN llResult
ENDIF
RETURN .F.