Jump to content
Sign in to follow this  

_FTP_ListToArray not updating! [SOLVED][IGNORE]

Recommended Posts

Hey All,

First time using _FTP_ functions with auto it but here is what im trying to do:

Bascially a very simple task.

1) Log into FTP server

2) Get list of folders and display

3) Create a new folder

4) Repeat Step 2

You may ask why? Well its intergrated into a much bigger project, this is the my issue scaled down.

My problem is this.

I can get the list of files and display them fine.

I can create the new folder

Now, when i get the list AGAIN it doesn't seem to display it with the new folder added.

I have tried, inserting a huge sleep() between the call of the Listtest().

Closing the FTP conn using _FTP_Close and they starting a new one.

None of the above works.

However when the script terminates and is rerun it will get the list with the new folder, but again on the second call it won't show any additional folders added.

Here is the code, you will need an FTP server of your own to test this.

#Include <FTPEx.au3>

$ftpOpen = _FTP_Open("My Test FTP")
$ftpConn = _FTP_Connect($ftpOpen, "server", "user", "password")
;_FTP_DirSetCurrent($ftpConn, "htdocs") ; This is not relevant to you.

_FTP_DirCreate($ftpConn, "Test Dir") ; Create a test dir



Func ListTest()
    local $list

    $list = _Ftp_ListToArray($ftpConn, 1) ; get list of folders

    For $o In $list
        ConsoleWrite($o & @CRLF) ; display folder names in console.

I hope it makes sense?

Thanks for any help.


Edited by Steveiwonder

They call me MrRegExpMan

Share this post

Link to post
Share on other sites

I did the ultimate noob thing and searched the forum after i posted this.


$INTERNET_FLAG_RELOAD ; forces reload

Sorry all.

Let the flame begin!

Edited by Steveiwonder

They call me MrRegExpMan

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...