cURL / Mailing Lists / curl-library / Single Mail


Re: FTP directory processing

From: Henke, Markus <>
Date: Thu, 9 Jan 2003 11:56:33 +0100

Hello @all,

On Thu, 9 Jan 2003, Stenberg, Daniel wrote:
> No. LIST shows a listing that the server can show
> anyway it wants. NLST shows a listing that on some
> servers don't include all directory entries.

I've feared to get this answer... =]

> > - If not, it seems that even ftp daemons on the
> > same platform produce different listings!?

> Yes, that is correct. FTP client authors have to sweat
> a lot to write parsers that understand the plethora of
> formats.

Groovy... 8|

> > More precise: Is there a way to do something similar
> > to "CURLOPT_QUOTE" w/o a "curl_easy_perform"?

> Nope. While this may sound strange to some people,
> remember that libcurl is a file transfer library,
> it is not a generic nor a complete FTP library.

That's clear. It's just the way that it seems
obvious that "libcurl" is able to send arbitrary
commands to a (FTP-) server, otherwise features
like "CURLOPT_QUOTE" won't work (or am i wrong
Maybe it's an idea to provide an API for that
functionality, or would this corrupt the proper
meaning of "libcurl"?
(However, i'll dive into the source to see how
things work under the surface and if there's
something i can wangle in that direction...)

> > - By now i'm using CURLOPT_NOBODY to suppress
> > the result of the above mentioned
> > "curl_easy_perform", but i guess the response
> > (e.g. a directory listing) is send over the network
> > and only suppresssed in libcurl!?

> No. If you specify NOBODY, libcurl won't get any data,
> and thus is won't LIST or NLST or anything.

Ahem, don't know if i got that right. Does that mean
that *no* response is send from server to client if
CURLOPT_NOBODY is declared?
If so, than a "curl_easy_perform" with an arbitrary
(non-existing?) URL and "CURLOPT_QUOTE" & "CURLOPT_NOBODY"
seems to act similar to a command that is directly send
to the server?
(Maybe i'm a little confused now,
i'm quite new to libcurl... =)

> > - If all that doesn' work; any comments / suggestions
> > how to process the various formats of directory listings?

> Check out other open source program that parse listings.
> wget comes to mind, as well as Bernstein's ftpparse:

Fine, i'll check this...

> --
> Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.

Many, many thanx & Ciao, Markus

This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
Received on 2003-01-09