Author | Topic: FTPClient:get in LOOP | |
---|---|---|
S.Slavic | FTPClient:get in LOOP on Fri, 21 Feb 2003 17:37:06 +0100 Hi, why cFile is not refreshed, although it is changed on remote server during the loop? Function fFTPClientGet() returns all the time the same version of the file (cFile), created before starting program. TIA #pragma Library( "ASINet10.lib" ) *------------------------------------------------------------------------------- PROCEDURE Main LOCAL cFtpServer := "" LOCAL cUserName := "" LOCAL cPassword := "" LOCAL ite LOCAL cFile:='ftptest.' FOR ite:=1 TO 10 fFTPClientGet(cFtpServer,cUserName,cPassWord,cFile,cFile) NEXT RETURN *------------------------------------------------------------------------------- FUNCTION fFTPClientGet(cFtpServer,cUserName,cPassWord,cFileFrom,cFileTo) LOCAL oFtp,cPom:='' oFtp := FTPClient():new( cFtpServer, cUserName, cPassWord ) IF .NOT. oFtp:connect() MsgBox('fFTPClient();'+'Unable to establish connection to:'+cFtpServer) oFtp:disconnect() RETURN NIL ENDIF cPom:=oFtp:get(cFileFrom) MsgBox('fFTPClientGet();'+'cFileFrom:'+cFileFrom+',cPom:'+cPom) MEMOWRIT(cFileTo,cPom) oFtp:disconnect() RETURN cPom *------------------------------------------------------------------------------- |