Jump to content

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

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

Sleep(10000)
ListTest()


_FTP_Close($ftpOpen)

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

I hope it makes sense?

Thanks for any help.

Steve

Edited by Steveiwonder

They call me MrRegExpMan

Link to comment
Share on other sites

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

http://www.autoitscript.com/forum/index.php?showtopic=111122&st=0&p=779700&hl=_FTP_ListToArray&fromsearch=1&#entry779700

$INTERNET_FLAG_RELOAD ; forces reload

Sorry all.

Let the flame begin!

Edited by Steveiwonder

They call me MrRegExpMan

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