Sucht die erste Datei auf einem FTP-Server
#include <FTPEx.au3>
_FTP_FindFileFirst ( $hFTPSession, $sRemotePath, ByRef $hFTPFind [, $iFlags = 0 [, $iContext = 0]] )
$hFTPSession | Rückgabewert von _FTP_Connect(). |
$sRemotePath | Pfad auf dem Server, in dem die Datei gesucht wird. |
$hFTPFind | Gibt ein Handle zurück, das für _FTP_FindFileNext() oder _FTP_FindFileClose() benötigt wird. |
$iFlags | [optional] $iFlags kann eine Kombination haben aus: $INTERNET_FLAG_HYPERLINK (0x00000400) $INTERNET_FLAG_NEED_FILE (0x00000010) $INTERNET_FLAG_NO_CACHE_WRITE (0x04000000) $INTERNET_FLAG_RELOAD (0x80000000) $INTERNET_FLAG_RESYNCHRONIZE (0x00000800) |
$iContext | [optional] Eine Variable, die eien anwendungsdefinierten Wert enthält, der diese Suche mit beliebigen Anwendungsdaten verknüpft. Dies wird nur benutzt, wenn die Anwendung bereits die Funktion _FTP_SetStatusCallback() aufgerufen hat, um eine Status Callbackfunktion zu installieren. |
Erfolg: | Ein Array: [0] - Anzahl der Elemente [1] - Dateiattribute [2] - Erstellzeit (Lo) [3] - Erstellzeit (Hi) [4] - Zugriffszeit (Lo) [5] - Zugriffszeit (Hi) [6] - Letzter Schreibzugriff (Lo) [7] - Letzter Schreibzugriff (Hi) [8] - Dateigröße (Hi) [9] - Dateigröße (Lo) [10] - Dateiname [11] - Alternativname |
Fehler: | 0 und setzt das @error Flag auf ungleich null |
_FTP_FindFileClose, _FTP_FindFileNext, _FTP_SetStatusCallback
Suche nach FtpFindFirstFile in der MSDN Bibliothek.
#include <FTPEx.au3>
;~ Local $sServer = 'ftp.cs.brown.edu' ; Brown Computer Science
Local $sServer = 'speedtest.tele2.net' ; Tele2 Speedtest Service
Local $sUsername = ''
Local $sPass = ''
Local $hOpen = _FTP_Open('MyFTP Control')
Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
Local $h_Handle
;~ Local $aFile = _FTP_FindFileFirst($hConn, "/pub/papers/graphics/research/", $h_Handle)
Local $aFile = _FTP_FindFileFirst($hConn, "/", $h_Handle)
ConsoleWrite('$FileName = ' & $aFile[10] & ' Attribute = ' & $aFile[1] & ' -> Fehlerccode: ' & @error & @CRLF)
Local $iFindClose = _FTP_FindFileClose($h_Handle)
Local $iFtpc = _FTP_Close($hConn)
Local $iFtpo = _FTP_Close($hOpen)