cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: list (no root) directory

From: Alessandro Vesely <vesely_at_tana.it>
Date: Wed, 25 Jul 2007 12:40:48 +0200

Daniel Stenberg wrote:
> On Mon, 23 Jul 2007, Sebastien WILLEMIJNS wrote:
>
>> the trouble was "ftp://ftp.free.fr/pub" worked well in FX and MSIE but
>> not in curl ;)
>
> curl always required a trailing slash to list the directory.
>

Let me take this occasion to note that for http urls the trailing slash
is required. For instance, for http://curl.haxx.se/mail one gets

    HTTP/1.x 301 Moved Permanently
    Location: http://curl.haxx.se/mail/

FTP has no support for redirection. Thus browsers work by trial and error:
they try anonymous login and try RETRieving the directory, before trying
CWD into it.

For both protocols, that behavior is inefficient an is only justified
for aiding unskilled users when they type target urls directly. URLs
written inside html pages and scripts should be correct, if possible.
Received on 2007-07-25