Function Reference


_FTP_FindFileFirst

Find First File on an FTP server

#include <FTPEx.au3>
_FTP_FindFileFirst ( $hFTPSession, $sRemotePath, ByRef $hFTPFind [, $iFlags = 0 [, $iContext = 0]] )

Parameters

$hFTPSession as returned by _FTP_Connect().
$sRemotePath path to be used when searching the file.
$hFTPFind returns Handle to be used in _FTP_FindFileNext() or _FTP_FindFileClose().
$iFlags [optional] $iFlags can be a combination of :
    $INTERNET_FLAG_HYPERLINK
    $INTERNET_FLAG_NEED_FILE
    $INTERNET_FLAG_NO_CACHE_WRITE
    $INTERNET_FLAG_RELOAD
    $INTERNET_FLAG_RESYNCHRONIZE
$iContext [optional] A variable that contains the application-defined value that associates this search with any application data.
This is only used if the application has already called _FTP_SetStatusCallback() to set up a status callback function.

Return Value

Success: an array:
[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
Failure: 0 and sets the @error flag to non-zero.

Related

_FTP_FindFileClose, _FTP_FindFileNext, _FTP_SetStatusCallback

See Also

Search FtpFindFirstFile in MSDN Library.

Example

#include <FTPEx.au3>

Local $sServer = 'ftp.csx.cam.ac.uk'
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/software/programming/pcre/", $h_Handle)
ConsoleWrite('$sFileName = ' & $aFile[10] & ' attribute = ' & $aFile[1] & '  -> Error code: ' & @error & @CRLF)

Local $iFindClose = _FTP_FindFileClose($h_Handle)

Local $iFtpc = _FTP_Close($hConn)
Local $iFtpo = _FTP_Close($hOpen)