Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords:
AddExtender( "WWINT44I.DLL" ) tophandle = iBegin( 0, "", "" ) conhandle = iHostConnect( tophandle,"ftp.windowware.com", @FTPPASSIVE, "", "" ) If conhandle == 0 Message( "ERROR" , "Unable to connect to host" ) Exit EndIf newdir = iFtpDirChange( conhandle, "/wwwftp/wb01" ) If newdir == 0 Message( "Change Dir", "NOT Successful" ) iClose( conhandle ) iClose( tophandle ) Exit EndIf cmdhandle=iFtpCmd(conhandle,"PASV","",@ASCII) If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf cmdhandle=iFtpCmd(conhandle,"LIST","",@ASCII) ;works If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf ;iReadDatabuf is used to read the pending data from the iFtpCmd LIST command size = 65536 buf = BinaryAlloc( size ) bufaddr = IntControl ( 42, buf, 0, 0, 0 ) ;Get address of buffer bytes = iReadDataBuf( cmdhandle, bufaddr, size ) BinaryEodSet( buf, size ) list = BinaryPeekStr(buf, 0, bytes) ;replace CRLF with TAB list = StrReplace( list, @CRLF, @TAB ) AskItemlist('iFtpCmd - LIST', list, @TAB, @UNSORTED, @SINGLE ) ;Clean up iClose(cmdhandle) iClose(conhandle) iClose(tophandle)
AddExtender( "WWINT44I.DLL" ) tophandle = iBegin( 0, "", "" ) conhandle = iHostConnect( tophandle,"ftp.windowware.com", @FTPPASSIVE, "", "" ) If conhandle == 0 Message( "ERROR" , "Unable to connect to host" ) Exit EndIf newdir = iFtpDirChange( conhandle, "/wwwftp/wb01" ) If newdir == 0 Message( "Change Dir", "NOT Successful" ) iClose( conhandle ) iClose( tophandle ) Exit EndIf cmdhandle=iFtpCmd(conhandle,"PASV","",@ASCII) If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf cmdhandle=iFtpCmd(conhandle,"LIST","",@ASCII) ;works If cmdhandle==0 err=iGetResponse() Message("iFtpCmd Error",err) iClose(cmdhandle) iClose(conhandle) iClose(tophandle) Exit EndIf ;iReadDatabuf is used to read the pending data from the iFtpCmd LIST command chunksize = 1024 bytes = 1 list = "" While bytes!=0 buf = BinaryAlloc( chunksize ) bufaddr = IntControl ( 42, buf, 0, 0, 0 ) ;Get address of buffer bytes = iReadDataBuf( cmdhandle, bufaddr, chunksize ) BinaryEodSet( buf, chunksize ) chunk = BinaryPeekStr(buf, 0, bytes) ;Pause( 'Chunk', chunk ) list = list:chunk BinaryFree( buf) EndWhile ;replace CRLF with TAB list = StrReplace( list, @CRLF, @TAB ) AskItemlist('iFtpCmd - LIST', list, @TAB, @UNSORTED, @SINGLE ) ;Clean up iClose(cmdhandle) iClose(conhandle) iClose(tophandle)
Article ID: W16887
File Created: 2012:10:09:15:09:28
Last Updated: 2012:10:09:15:09:28