🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #960

Re: Problem using TIdFTP in C++ Builder 2007. List() doesn't work

#960
From: Star
Date: Fri, 20 Jul 2007 20:07
84 lines
3655 bytes
wow... thanks a lot, Remy. I'm surprised how it works now. I think they 
should have made that differently. I think it would be easier if you 
could specify the parser by code instead of adding header files...

Anyway, I have tried it but still doesn't work.

This is my whole test project:

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
#include "IdAllFTPListParsers.hpp"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "IdExplicitTLSClientServerBase"
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
     IdFTP1->Username = "anonymous";
     IdFTP1->Password = "fsjksdfj@fsjfsdj.com";
     IdFTP1->Host = "ftp.borland.com";
     IdFTP1->Port = 21;
     IdFTP1->AutoLogin = true;

     IdFTP1->Connect();

     IdFTP1->List( NULL, "", true);

     for(int i = 0; i < IdFTP1->DirectoryListing->Count; ++i)
     {

     }

}


Do you think I am missing something?

I'm using C++ Builder 2007, which comes with Indy 10.1.5

Thanks




Remy Lebeau (TeamB) wrote:
> "Star" <noemai@noemail.com> wrote in message
> news:46a108f5$1@newsgroups.borland.com...
> 
>> For some reason, IdFTP1->DirectoryListing->Count is always 0.
> 
> Please read the Indy 10 documentation.  This issue is covered in the
> DirectoryListing topic.
> 
> The formatting of FTP listings in the LIST and NLST commands are not
> standardized at all.  Servers are free to use whatever they want.  There are
> new drafts that introduce additional commands that have standardized
> formats, but not all servers support them yet.  As such, there are dozens of
> formats used online today.
> 
> In Indy 9, the DirectoryListing supported only a few hard-coded formats that
> were commonly used.
> 
> In Indy 10, the DirectoryListing was completely redesigned to use a plugin
> system now.  Indy 10 has several dozen parser plugins available, but none of
> them are enabled by default.  That is why the Count is always 0 -
> DirectoryListing doesn't know how the parse the data.  You have to include
> the appropriate IdFTPListParse...hpp header files for the specific parser(s)
> that you want to use.  Or alternatively include the IdAllFTPListParsers.hpp
> header file to enable them all.
> 
> 
> Gambit
> 
> 
Technical Details
Message-ID: <46a11619$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <46a108f5$1@newsgroups.borland.com> <46a11115$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,f37f99fb538f42a3
X-Google-Attributes: gid11508e,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 20 Jul 2007 16:07:25 -0400
From: Star <noemai@noemail.com>
User-Agent: Thunderbird 1.5.0.12 (Windows/20070509)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: Problem using TIdFTP in C++ Builder 2007. List() doesn't work
References: <46a108f5$1@newsgroups.borland.com> <46a11115$1@newsgroups.borland.com>
In-Reply-To: <46a11115$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 70.91.64.254
Message-ID: <46a11619$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1184962073 70.91.64.254 (20 Jul 2007 13:07:53 -0700)
Lines: 84
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail