Re: TidFTP.DirectoryListing in Indy 10 does not work?

Giganews Newsgroups
Subject: Re: TidFTP.DirectoryListing in Indy 10 does not work?
Posted by:  Don S (mudsha…
Date: Wed, 9 Jun 2004

"Daniel" <dt…> wrote in message news:ceidc0lmou54lau2a9jgm3s9krq3tevm…

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

Do you know the list format returned by the FTP host?  In Indy 10, the NLST and MLST formats are registered by default.

If the list format is some other, you need to use the  corresponding IdFTPListParse*.pas unit in the uses clause to enable it.  For example, to use the Windows NT parser include "IdFTPListParseWindowsNT" in the uses clause for the program.  This forces it to be registered and available for handling results in the List method.




In response to

TidFTP.DirectoryListing in Indy 10 does not work? posted by Daniel on Wed, 09 Jun 2004