Board index » cppbuilder » Indy 9 FTP component

Indy 9 FTP component


2004-06-25 11:47:44 PM
cppbuilder108
Hi,
I'm using Indy V9 FTP component as shown below but I have a problem
accessing the FTP filename, it shows the complete line with permissions file
size etc.
How do I parse this correctly? (using a unix FTP server).
TStringList *LS = new TStringList;
int numitems;
IdFTP1->Connect(true,10000);
IdFTP1->List(LS,"*.*",true);
DirectoryListBox->Items->Assign(LS);
numitems = IdFTP1->DirectoryListing->Count;
for (int i=0;i<numitems;i++)
{
Memo2->Lines->Add(IdFTP1->DirectoryListing->Items[i]->FileName);
}
IdFTP1->Disconnect();
delete LS;
thanks in advance,
Liam Mullane.
 
 

Re:Indy 9 FTP component

"Liam Mullane" < XXXX@XXXXX.COM >wrote in message
Quote
I'm using Indy V9 FTP component as shown below but I have a problem
accessing the FTP filename, it shows the complete line with permissions
file
size etc.
How do I parse this correctly? (using a unix FTP server).

Hi Liam,
I would try asking this in one of the Indy forums at
Your code looks OK to me, and Indy claims to detect and parse the standard
unix FTP directory format - I haven't tried this myself, though. You could
check what the value of IdFTP1->DirectoryListing->ListFormat is correctly
set to flfUnix?
Hope that helps.
- Roddy
 

Re:Indy 9 FTP component

TStringList *fileList;
fileList=new TStringList;
//fill connection parameters
//...
IdFTP1->Connect(true,5000);
//change dir (optional)
IdFTP1->List(fileList,Label1->Caption,false); //the last parameter actually
does the trick... if set tu true, it displays permissions...
Hope this helps...
<MortZ>
 

{smallsort}