Jump to content

_FTPEx _FTP_ListToArray problem (SOLVED)


Recommended Posts

I have written a program to get files from a FTP site using _FTPEx.au3.

I'm using the _FTP_ListToArray function to get a list of the files, and everything seems OK on 64-bit OS, but it just hangs on a 32-bit OS.

Specifically, it is working on Windows 10 64-bit, and Windows 7 64-bit - but hanging on Windows 7 32-bit.

A snippet of the code I'm using is...

;read the list of files in the directory
    Write_To_Log("...getting the list of files on the FTP")
    Local $returnarray = _FTP_ListToArray($FTPConn, 2)
    If $returnarray[0] = 0 Then
        Write_To_Log("...error reading the list of files on the FTP - no files returned")
        Return False
    Else
        ;see if the file was found
        Local $filefound = False
        Local $i
        For $i = 1 To UBound($returnarray) - 1
            Write_To_Log("...found the file " & $returnarray[$i])
            If $returnarray[$i] = $FTPFileName Then
                $filefound = True
                Write_To_Log("...required file found")
            EndIf
        Next
    EndIf

Write_To_Log is a function that just writes out to a text file so I can see what's going on - it logs "...getting the list of files on the FTP" and then just hangs.

Anyone out there can help?

 

Back up my hard drive? - I can't even find reverse gear.

Link to comment
Share on other sites

The functions are based on WinInet.dll, so you could try seeing what happens when you use this:

If DllOpen("wininet.dll") = -1 Then
    ConsoleWrite("! Error - Unable to open dll.")
Else
    ConsoleWrite("No issues finding Dll.")
EndIf
Edited by seadoggie01

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

Sorry, should've seen that. Sounds like you're getting stuck in the (internal) __FTP_ListToArray function... there's a do - while loop in there that is checking for another file. I read about the Dll calls it's making, but none seem to indicate anything different with 32/64 versions. You can try backing up FTPEx.au3 and editing it to try to find where it's erroring, but I don't see any issues 😐

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

@seadoggie01, @Nine - it's still not playing for me, so after lots of fiddling around with FTPEx, I found that it's hanging on the call to the function FtpFindFirstFileW - snippet from FTPEx.au3....

Local $aCallFindFirst = DllCall($__g_hWinInet_FTP, 'handle', 'FtpFindFirstFileW', 'handle', $hFTPSession, 'wstr', "", 'struct*', $tWIN32_FIND_DATA, 'dword', $iFlags, 'dword_ptr', $iContext)

It just hangs at that point.

Back up my hard drive? - I can't even find reverse gear.

Link to comment
Share on other sites

@seadoggie01, @Nine - eventually I found out it's the windows firewall - on the 64 bit machines it was just allowing the connection through, but not on the 32-bit machine, even though port 21 was allowed - I had to turn on notifications on the 32-bit machine to get the program added to the firewall.

Back up my hard drive? - I can't even find reverse gear.

Link to comment
Share on other sites

  • ozymandius257 changed the title to _FTPEx _FTP_ListToArray problem (SOLVED)

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

×
×
  • Create New...