List(); Unexpected result

Giganews Newsgroups
Subject: List(); Unexpected result
Posted by:  Jaepil Kim (jaep…@spalshmedia.co.nz)
Date: Tue, 03 Aug 2004

Hi i m using Indy9 with BCB5.

On my FTP server i have following structure.

/test/
/test/9999

When i excute following code, i get '9999' as a result.
I was expecting to see 'test'. What am i doing wrong?

//-------------------------------------------------------

// Connect to the server
IdFTP1->Host = Host;
IdFTP1->Username = Username;
IdFTP1->Password = Password;
IdFTP1->Connect(true, IdTimeoutDefault);
IdFTP1->ChangeDir("/");

// Get a list of folders
IdFTP1->TransferType = ftASCII;
TStringList *l_ServerFileList = new TStringList();
IdFTP1->List(l_ServerFileList, "*", true);

// Show the first directory's name
//
// I expected to see 'test' but got '9999'
//
if (IdFTP1->DirectoryListing->Count > 0) {
  ShowMessage(IdFTP1->DirectoryListing->Items[0]->FileName);
}

Replies