Jump to content

_FTP_ListToArrayEx Problem


Recommended Posts

I am having a very weird problem with this function and I looked at it for a while and finally went back to the example given in the UDF. That is doing weird things as well. At least for me.

First, I just (yesterday) downloaded and updated my Autoit software. So I have the latest and greatest package. My system has tons of memory and - for the most part - seems to functioning properly (unless I write some weird script). So anyway....

Here is the example script given by the CHM:

#include <FTPEx.au3>
#include <Array.au3>

Local $server = 'ftp.csx.cam.ac.uk'
Local $username = ''
Local $pass = ''

Local $Open = _FTP_Open('MyFTP Control')
Local $Conn = _FTP_Connect($Open, $server, $username, $pass)

Local $aFile = _FTP_ListToArrayEx($Conn, 0)
_ArrayDisplay($aFile)

Local $Ftpc = _FTP_Close($Open)

This comes back with all of the information showing. This is great - right? Yes! It is! But you are also supposed to be able to set that number to one(1) or two(2) for just directories or just files. But when you do - you get nothing back. I think that's a problem. :-/

Now! To make matters worse. If I run the above code against my website I get:the first image.

But if I copy/paste the above code into MY program and run it I get the second image.

And if I change that zero(0) to a one(1) or a two(2) I get the third image.

I also get the third image if I change the original program to using one or two as well.

It does this on the original UK site as well.

If I turn on passive move then everything is always zero (or no entries).

Ideas?

post-20272-0-00084200-1331483579_thumb.p

post-20272-0-23623200-1331483775_thumb.p

post-20272-0-42264000-1331483865_thumb.p

Link to comment
Share on other sites

Ok - found out part of the problem. I went in to the FTPex.au3 file and looked at the code. All _FTP_ListToArrayEx does is to call _FTP_ListToArray. Only it is passing in the wrong number of arguments. When I try calling _FTP_ListToArray with the same number of arguments that _FTP_ListToArrayEx uses I get that dialog box. More as I figure out what is going on. :-)

post-20272-0-18216100-1331484856_thumb.g

Link to comment
Share on other sites

_FTP_ListToArrayEx isn't sending the function _FTP_ListToArray the wrong number of parameters, _FTP_ListToArray takes one more parameter than _FTP_ListToArrayEx uses, the $ArrayCount parameter for _FTP_ListToArray isn't needed for _FTP_ListToArrayEx because it always sends it "6" which tells the function to return all information. Your problem probably lies elsewhere.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

Oops! It is calling __FTP... not _FTP... My bad. Still looking at it. Thinking I may just do the shell call to FTP instead. Because I don't see anything wrong with the functions per se. So it must be something internal to the Windows API. :-/

Link to comment
Share on other sites

Well - you see - I could accept that except I used the example program and IT even did this weird behavior. All I did was to change the $conn, 0 to $conn, 1 and $conn 2 and 1 & 2 come back blank. Only 0 shows everything. So even if you just took my program and threw it in the trash - the example program is messing up in the same manner. No other changes. Only that one value. Can you explain that? I can't.

Here is some more info on this:

1. If I just use the regular RunWait() command a do an FTP -S:FTP.CMD line to it - it works very nicely

But - I tried this in PHP - with the same results using PHP's FTP built-in commands (and the same results when I tell PHP to use the shell script).

This would indicate a problem with my OS only - wouldn't the shell scripts not work as well? So I tried FileZilla - works perfectly. Perl's shell script works perfectly. Freebasic's shell script works perfectly.

So my only conclusion is - there is something weird going on with Windows XP on my system or there is an obscure bug which I, in my position as village idiot, have managed to stumble upon. Lucky me. One other theory I have is my anti-virus software is mucking up the connection. I'll need to turn that off and try it here in a bit. I'm using Avira and it has, on occasion, mucked around with other programs and Avira has popped up a couple "Do you trust this app?" questions already. So Avira could be mucking around with things as well.

Well, more later as I figure this out. :-)

Link to comment
Share on other sites

you are also supposed to be able to set that number to one(1) or two(2) for just directories or just files. But when you do - you get nothing back. I think that's a problem. :-/

BugTracker ticket #1970 corrected that. It was not impemented until beta 3.3.9.0. So, you'll need to either run the beta, or manually apply the same fix to the 3.3.8.0 UDF.

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...