🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.internet.socket
3 messages
3 total messages Started by Dmitri L. Tue, 06 Nov 2007 12:55
C++ Builder 2007 - IdFTP versus List()
#779
Author: Dmitri L.
Date: Tue, 06 Nov 2007 12:55
45 lines
1464 bytes
I'm trying to get a detailed list of files from a IIS 6.0 webserver using 
IdFTP (v10.1.5) and C++ Builder 2007. I can't make it work, I''m receiving 
an error.



I'm using the following source:



IdFTP1->Connect();

if(IdFTP1->Connected())

{

try    {

          IdFTP1->TransferType = ftASCII;

          IdFTP(NULL, "", true);
        }

catch(Exception &exception)

        {

           ShowMessage(exception.Message);

        }

}



The error is 'EDivByZero' and the 'ListResult' is empty. I'm not sure what 
to do. Do I need to downgrade to Indy 9?



Thanks in advance for your help!



Dmitri L.
Re: C++ Builder 2007 - IdFTP versus List()
#780
Author: Remy Lebeau (TeamB)
Date: Tue, 06 Nov 2007 17:27
43 lines
2267 bytes
"Dmitri L." <nospam@nospam.com> wrote in message 
news:47306457@newsgroups.borland.com...

> I'm trying to get a detailed list of files from a IIS 6.0 webserver
> using IdFTP (v10.1.5) and C++ Builder 2007

10.1.5 is an old version of Indy 10.  It shipped with BDS 2006.  Try going 
to Indy's website and upgrade to the current 10.2.3 snapshot.

> IdFTP1->Connect();
>
> if(IdFTP1->Connected())

You don't need to call Connected().  If Connect() fails, it will throw an 
exception.

>          IdFTP1->TransferType = ftASCII;

You don't need to set the TransferType before calling List().  List() does 
that internally for you.

>          IdFTP(NULL, "", true);

That is not a valid statement.  I assume you meant this instead:

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

> catch(Exception &exception)

Always catch exceptions by 'const' reference instead:

    catch(const Exception &exception)

> The error is 'EDivByZero' and the 'ListResult' is empty.

What does the actual raw listing data look like?  You can use an external 
packet sniffer, such as Ethereal/Wireshark, to find out.  Also, which 
IdFTPListParse... units have you included in your code for TIdFTP to use for 
parsing the data?


Gambit 
Re: C++ Builder 2007 - IdFTP versus List()
#781
Author: Remy Lebeau (TeamB)
Date: Tue, 06 Nov 2007 17:31
13 lines
1499 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:4730a4d6$1@newsgroups.borland.com...

> What does the actual raw listing data look like?  You can use
> an external packet sniffer, such as Ethereal/Wireshark, to find out.

Or look at TIdFTP's ListResult property, or pass a non-NULL TStrings-derived 
object to the first parameter of List().  Either of those will receive the 
raw data as well.


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