🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#967
From: Star
Date: Tue, 24 Jul 2007 19:30
83 lines
3968 bytes
> That would require a lot of runtime overhead to initialize things that the
> app may or may not actually use.  With the header file approach, you are
> specifying what you are actually interested in.

I don't know about you, but If I write an FTP client, I want this client 
to work with any type of ftp servers. I don't really know where this ftp 
client is going to connect to. The ftp server that the client is 
connecting should be transparent to the final user.
If we use your approach, every time I find out my client stops working, 
I have to recompile my project after adding the right header and send 
the new version to our customers... Who wants to do that?


With Indy 9 everything worked great. No wonder when I check the 
newsgroups there is so many people trying to use 9 instead of 10.

By the way, it seems that I'm not the only one who thinks that adding
header files is not very intuitive. Even the developers say that in the 
documentation!


> Like I said, there are only two possibilities for that.  Have you tried
> stepping through the parsing code yet to find out where the failure point
> is?  Did you try looking at the raw listing data that the server is actually
> sending back?

If I use IdFTP1->ListResult->Count I get the data correctly. The count 
is 2 and I get these 2 lines:

drwxr-xr-x    2 0        0            4096 Jun 27 20:45 downloads
drwxr-xr-x   22 0        0            4096 Jun 27 20:25 pub

However, IdFTP1->DirectoryListing->Count is always 0.


Don't you have Indy 10 on your computer? Could you just test the code 
that I posted here?

Just in case, here is my full source code again:

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

#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::Button1Click(TObject *Sender)
{

     IdFTP1->Username = "anonymous";
     IdFTP1->Password = "test@test.com";
     IdFTP1->Host = "ftp.borland.com";
     IdFTP1->Port = 21;

     IdFTP1->Connect();

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

     for(int i = 0; i < IdFTP1->ListResult->Count; ++i)
     {
      	AnsiString pp = IdFTP1->ListResult->Strings[i];
     }

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

     }
}

Thanks
Technical Details
Message-ID: <46a65374$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46a108f5$1@newsgroups.borland.com> <46a11115$1@newsgroups.borland.com> <46a11619$1@newsgroups.borland.com> <46a15625$1@newsgroups.borland.com> <46a4bea5$1@newsgroups.borland.com> <46a4e309$3@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: Tue, 24 Jul 2007 15:30:10 -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> <46a11619$1@newsgroups.borland.com> <46a15625$1@newsgroups.borland.com> <46a4bea5$1@newsgroups.borland.com> <46a4e309$3@newsgroups.borland.com>
In-Reply-To: <46a4e309$3@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: <46a65374$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1185305460 70.91.64.254 (24 Jul 2007 12:31:00 -0700)
Lines: 86
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 3829