Jump to content

Search the Community

Showing results for tags '_FTP_FindFileFirst'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 1 result

  1. If somebody could please explain to me why is function "_FTP_FindFileFirst" returning over and over again the same files that I have allready downloaded and deleted, and why does the function "_FTP_FileGet" reports "Succeeded" on downloading non-existing file? Only the function "_FTP_FileDelete" works OK (it reports Failed on all passes except the first). $iStatus = 0 $sServer = 'ftp.test.com' $sUsername = 'userftp' $sPass = 'passftp' $iInterval = 10 ConsoleWrite ('Opening a new FTP session ... ') $hOpen = _FTP_Open ('FTP Control ' & @AutoItPID) If @error Then ConsoleWrite ('Failed' & @CRLF) Sleep (5000) Exit EndIf ConsoleWrite ('Succeeded' & @CRLF) Dim $FTPTime = 1000*$iInterval, $FTPStart = TimerInit (), $FTPEnd = TimerDiff ($FTPStart) While 'FTP Connection' $FTPEnd = TimerDiff ($FTPStart) Select Case $FTPEnd > $FTPTime If NOT $iStatus Then ConsoleWrite ('Connecting to FTP server: ftp://' & $sUsername & ':' & $sPass & '@' & $sServer & ' ... ') $hConnect = _FTP_Connect ($hOpen, $sServer, $sUsername, $sPass, 1) If @error Then ConsoleWrite ('Failed' & @CRLF) $FTPStart = TimerInit () ContinueLoop EndIf ConsoleWrite ('Succeeded' & @CRLF) ConsoleWrite ('--------------------------------------------------' & @CRLF & @CRLF) EndIf $iStatus = _FTP_Command ($hConnect, 'STAT') If NOT $iStatus Then ConsoleWrite ('Connection to FTP server was lost' & @CRLF) $FTPStart = TimerInit () ContinueLoop EndIf Dim $h_Handle $aFile = _FTP_FindFileFirst ($hConnect, '/Dir1/Dir2/Dir3/', $h_Handle) If NOT @error Then While 'FTP Download/Delete' Sleep (10) ConsoleWrite ('File found: ' & $aFile[10] & @CRLF) ConsoleWrite ('Downloading file ... ') _FTP_FileGet ($hConnect, '/Dir1/Dir2/Dir3/' & $aFile[10], 'D:\TargetDir\' & $aFile[10], False) If @error Then ConsoleWrite ('Failed' & @CRLF) Else ConsoleWrite ('Succeeded' & @CRLF) ConsoleWrite ('Deleting file ... ') _FTP_FileDelete ($hConnect, '/Dir1/Dir2/Dir3/' & $aFile[10]) If @error Then ConsoleWrite ('Failed' & @CRLF) Else ConsoleWrite ('Succeeded' & @CRLF) EndIf EndIf ConsoleWrite ('--------------------------------------------------' & @CRLF) $aFile = _FTP_FindFileNext ($h_Handle) If @error Then ExitLoop WEnd EndIf $aClose = _FTP_FindFileClose ($h_Handle) ConsoleWrite ('No new files' & @CRLF) $FTPStart = TimerInit () EndSelect WEnd $hDisconnect = _FTP_Close ($hConnect) $hClose = _FTP_Close ($hOpen) Exit
×
×
  • Create New...