Re: Parse file.

Giganews Newsgroups
Subject: Re: Parse file.
Posted by:  Remy Lebeau (TeamB) (gambit47.no.spam@no.spam.yahoo.com)
Date: Mon, 28 Jun 2004

"Liam Mullane" <STOPSPAM.lmulla…@dairymaster.com> wrote in message
news:76ABC0BEC8A2E240STOPSPAM.lmulla…@dairymaster.com...

> I'm using Indy V9 FTP component. I have the following code
> that lists all files on the directory. How do I parse these files
> (using a unix FTP server) to get the FileName,Size,DateTime etc.

TIdFTP already does that for you.  Look at the DirectoryListing property,
ie:

    IdFTP1->Connect(true, 10000);
    try
    {
        DirectoryListBox->Items->Clear();
        IdFTP1->List(NULL, "*.*", true);
        for(int x = 0; x < IdFTP1->DirectoryListing->Count; ++x)
        {
            TIdFTPListItem *Item = IdFTP->DirectoryListing->Items[x];
            // use Item->FileName, Item->Size, and Item->ModifiedData as
needed...
        }
    }
    __finally {
        IdFTP1->Disconnect();
    }

Gambit

Replies

In response to

Parse file. posted by Liam Mullane on Mon, 28 Jun 2004