🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
6 messages
6 total messages Started by Ohta Sun, 19 Nov 2006 05:19
Indy9 - TIdFTP - List - BCB6
#1684
Author: Ohta
Date: Sun, 19 Nov 2006 05:19
30 lines
1848 bytes
Hello.

I have problems using Indy9 TIdFTPclient component on BCB6.

I'm trying to get the various informations, such as  FileName, Size and
ModiffiedDate
about FTP server files to use following code.

 try{
   TStringList *SL = new TStringList();
   IdFTP->List(SL,"*.txt",true);
   for(i=0;i<SL->Count;i++){
      Memo1->Lines->Add(IdFTP->DirectoryListing->Items[i]->FileName);
      Memo2->Lines->Add(IdFTP->DirectoryListing->Items[i]->Size);
      Memo3->Lines->Add(IdFTP->DirectoryListing->Items[i]->ModiffiedDate);
   }
 } __finally{
   delete SL;
 }

But  I can't get the correct information but get the following wrong
results.

Momo1 = "-r--r--r--   1 owner group  22592 Feb 27 23:02 test.txt"
Memo2 = "97031901151232"
Memo3 = "0:00:00"

Please tell me how to get the correct informations about FTP server files.

Regards, Ohta.
Re: Indy9 - TIdFTP - List - BCB6
#1688
Author: Remy Lebeau (TeamB)
Date: Mon, 20 Nov 2006 19:52
30 lines
2095 bytes
"Ohta" <kinukinu8@ybb.ne.jp> wrote in message
news:455fe9f3$1@newsgroups.borland.com...

> I have problems using Indy9 TIdFTPclient component on BCB6.

That is because you are using it wrong.  Use this instead:

    IdFTP->List(NULL, "*.txt", true);
    for(i = 0; i < IdFTP->DirectoryListing->Count; ++i)
    {
        Memo1->Lines->Add(IdFTP->DirectoryListing->Items[i]->FileName);
        Memo2->Lines->Add(IdFTP->DirectoryListing->Items[i]->Size);
        Memo3->Lines->Add(IdFTP->DirectoryListing->Items[i]->ModiffiedDate);
    }

> But  I can't get the correct information but get the following wrong
> results.

Until recently, there was NO standardized format for directory listings at
all.  Each server was completely free to use whatever format it wanted.  As
such, there are literally several dozen different formats being used on the
Internet.  TIdFTP in Indy 9 only supports a few of them.  Most of them are
simply not parsable by TIdFTP in Indy 9 at all.  Apparently you are
connecting to a server that is using one of those incompatible formats.  So
you will have to use the OnParseCustomListFormat event to parse the data
yourself.


Gambit
Re: Indy9 - TIdFTP - List - BCB6
#1701
Author: Ohta
Date: Thu, 23 Nov 2006 13:01
15 lines
1611 bytes
Hi, Thank you for replying.
I did read the manual of OnParseCustomListFormat or TIdFTPListFormat
 or TIdFTPListItems and so on.
But I could know how to use these.

Please show me the sample code or reference of URL .

> TIdFTP in Indy 9 only supports a few of them.  Most of them are
> simply not parsable by TIdFTP in Indy 9 at all.  Apparently you are
> connecting to a server that is using one of those incompatible formats.
So
> you will have to use the OnParseCustomListFormat event to parse the data
> yourself.

Regards, Ohta.
Re: Indy9 - TIdFTP - List - BCB6
#1702
Author: Remy Lebeau (TeamB)
Date: Thu, 23 Nov 2006 13:11
20 lines
1421 bytes
"Ohta" <kinukinu8@ybb.ne.jp> wrote in message
news:45659c3c@newsgroups.borland.com...

> Please show me the sample code or reference of URL .

    procedure TForm1.IdFTP1CheckListFormat(ASender: TObject; const ALine:
String; var VListFormat: TIdFTPListFormat);
    begin
        VListFormat := flfCustom;
    end;

    procedure TForm1.IdFTP1ParseCustomListFormat(AItem: TIdFTPListItem);
    begin
        // parse AItem.Data as needed...
        // fill in AItem properties as needed ...
    end;


Gambit
Re: Indy9 - TIdFTP - List - BCB6
#1703
Author: Ohta
Date: Thu, 23 Nov 2006 14:54
16 lines
1623 bytes
Hellow.
Thank you for showing me a sample code.

Although there are full information in AItem.FileName,
there are no information in AItem.Data. 

But I will try to make the parser for my target FTPserver.
Thank you very much.

Regards, Ohta.

>     procedure TForm1.IdFTP1ParseCustomListFormat(AItem: TIdFTPListItem);
>     begin
>         // parse AItem.Data as needed...
>         // fill in AItem properties as needed ...
>     end;
Re: Indy9 - TIdFTP - List - BCB6
#1708
Author: Remy Lebeau (TeamB)
Date: Thu, 23 Nov 2006 21:18
14 lines
1533 bytes
"Ohta" <kinukinu8@ybb.ne.jp> wrote in message
news:4565b6aa@newsgroups.borland.com...

> Although there are full information in AItem.FileName,
> there are no information in AItem.Data.

Inside the OnParseCustomListFormat event, the AItem.FileName property has
not been filled in yet.  That is the responsibility of the event handler to
do.  AItem.Data contains the raw data from the directory listing.  It is the
only property that has any value in that event.


Gambit
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads