Jump to content

FTP FindFile


mary
 Share

Recommended Posts

#Include <FTP.au3>

Global Const $Host = 'ftp.mozilla.org'
Global Const $Login = ''
Global Const $Password = ''

Global $hFtp, $hSession, $hFind, $tFind, $sFile

_FTP_Startup()

$hFtp = _FTP_Open('MyFtp')
$hSession = _FTP_Connect($hFtp, $Host, $Login, $Password)

$tFind = DllStructCreate($tagWIN32_FIND_DATA)
$hFind = _FTP_FileFindFirst($hSession, '', $tFind)
While Not @error
    $sFile = DllStructGetData($tFind, 'FileName')
    If StringCompare(StringRegExpReplace($sFile, '^.*\.', ''), 'cfg') = 0 Then
        ConsoleWrite($sFile & @CR)
    EndIf
    _FTP_FileFindNext($hFind, $tFind)
WEnd
_FTP_FileFindClose($hFind)

_FTP_Disconnect($hSession)
_FTP_Close($hFtp)

_FTP_Shutdown()

FTP.au3

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...