TidFTP.DirectoryListing in Indy 10 does not work?

Giganews Newsgroups
Subject: TidFTP.DirectoryListing in Indy 10 does not work?
Posted by:  Daniel (dt…@pacific.net.sg)
Date: Wed, 09 Jun 2004

Hi,

I am trying out the latest version of Indy 10 (10.0.18-B for Delphi 7)
and couldn't get DirectoryListing working.

I created a simple application and dropped a TIdFTP component onto the
form, set the host name, user name and password, then used the OnClick
event of a button to connect to a FTP server.

The excerpt of my code is as follows:

  pFTPClient.AutoLogin := False;
  pFTPClient.Connect;
  if pFTPClient.Connected then begin
    pFTPClient.Login;
    pFTPClient.List(pMemo.Lines);
    ShowMessage(IntToStr(pFTPClient.DirectoryListing.Count));
  end;

The pFTPClient.DirectoryListing.Count is always 0 even when the list
is propagated to the Memo correctly.  Am I missing any steps?  Please
advise.  Thanks in advance.

Regards,
Daniel

Replies