ProgAndy Posted December 27, 2008 Share Posted December 27, 2008 (edited) _FTPFilesListToArray works this way: $FileArray = _FTPFilesListToArray($FTP) _ArrayDisplay($FileArray) There are also another function to list files: _FTPFilesListTo2DArray -> also lists filesize Btw: You have to use the $FTP handle in all funcs, not the string MyFTPControl with _FTPClose, first have to close the $FTP and then the $OPen handles when you are closing FTP: _FTPClose($FTP) _FTPClose($Open) To use the filefind functions diretcly: Local $Handle, $Struct $FirstFileArray = _FTPFileFindFirst($FTP,'',$Handle, $Struct) Do $NextFileArray = _FTPFileFindNext($Handle, $Struct) Until @error <> 0 _FTPFileFindClose($Handle, $Struct) The Arrays returned from FilefindFirst and filefindnext include this information: CODE; ReturnArray: ; [0] - Number of elements ; [1] - File Attributes ; [2] - Creation Time Low ; [3] - Creation Time Hi ; [4] - Access Time Low ; [5] - Access Time Hi ; [6] - Last Write Low ; [7] - Last Write Hi ; [8] - File Size High ; [9] - File Size Low ; [10] - File Name ; [11] - Altername To read filetime from Low and Hi, use _FTPFileTimeLoHiToStr to get file size from Low and Hi use _FTPFileSizeLoHi Edited December 27, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
FireFox Posted December 27, 2008 Share Posted December 27, 2008 @ProgAndy Thanks for your help ! _FTPFileFindNext search on other folder ? If yes it doesnt work expandcollapse popup#include <Array.au3> #include <FTP_Ex.au3> Opt("GuiOnEventMode", 1) #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $DLL = DllOpen('wininet.dll') Local $FTP, $Open #Region FTP-GUI CONNECT $win = GUICreate("FTP Connect example", 160, 160, -1, -1, -1, BitOR($WS_EX_APPWINDOW, $WS_EX_TOOLWINDOW)) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUICtrlCreateLabel("FTP server", 5, 5) $server = GUICtrlCreateEdit("", 5, 20, 150, 20, $ES_AUTOHSCROLL) GUICtrlCreateLabel("FTP username", 5, 50) $username = GUICtrlCreateEdit("", 5, 65, 150, 20, $ES_AUTOHSCROLL) GUICtrlCreateLabel("FTP password", 5, 95) $password = GUICtrlCreateInput("", 5, 110, 150, 20, $ES_AUTOHSCROLL + $ES_PASSWORD) GUICtrlCreateButton("CONNECT", 5, 135, 150, 20) GUICtrlSetOnEvent(-1, "_FTP") GUISetState(@SW_SHOW, $win) #EndRegion FTP-GUI CONNECT #Region FTP-GUI LIST $win = GUICreate("FTP List Files example", 160, 160, -1, -1, -1, BitOR($WS_EX_APPWINDOW, $WS_EX_TOOLWINDOW)) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") GUISetState(@SW_HIDE, $win) #EndRegion FTP-GUI LIST Func _Exit() _FTPClose($FTP) _FTPClose($Open) DllClose($DLL) Exit EndFunc ;==>_Exit Func _OnAutoItExit() _FTPClose($FTP) _FTPClose($Open) DllClose($DLL) EndFunc ;==>_OnAutoItExit Func _FTP() $Open = _FTPOpen('MyFTPControl') $FTP = _FTPConnect($Open, GUICtrlRead($server), GUICtrlRead($username), GUICtrlRead($password)) If @error Then TrayTip("FTP Example", "Could not connect to ftp !", 2, 2) Else TrayTip("FTP Example", "Connected to ftp !", 2, 1) GUISetState(@SW_HIDE, $win) ;~ MsgBox(64, "_FTPListFiles", _FTPFilesListToArray($FTP)) $FileArray = _FTPFilesListToArray($FTP) _ArrayDisplay($FileArray) Local $Handle, $Struct $FirstFileArray = _FTPFileFindFirst($FTP, '', $Handle, $Struct) ;~ MsgBox(64, "_FTPFileFindFirst", $FirstFileArray) _ArrayDisplay($FirstFileArray) Do $NextFileArray = _FTPFileFindNext($Handle, $Struct) ;~ MsgBox(64, "_FTPFileFindNext", $NextFileArray) _ArrayDisplay($NextFileArray) Until @error <> 0 Or $NextFileArray = '' _FTPFileFindClose($Handle, $Struct) EndIf EndFunc ;==>_FTP While 1 Sleep(250) WEnd Cheers, FireFox. Link to comment Share on other sites More sharing options...
ProgAndy Posted December 27, 2008 Share Posted December 27, 2008 (edited) _FTPFileFindNext doens't search in other subfolders you have to do that manually as a recursive function. it just works like FileFindFirstFile / FileFindNextFile in AutoIt for the local file system. Edited December 27, 2008 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
FireFox Posted December 27, 2008 Share Posted December 27, 2008 @ProgAndy KK... Thanks Cheers, FireFox. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now