cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CR/LF in URL

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Tue, 11 Apr 2006 09:36:46 -0500

RM> This has bitten me before. I usually use tr to strip the CR:

Indeed, tr works great for this. But I think the issue
is not so much with *solving* the problem as it is with
*finding* the problem...

curl -l ftp://ftp.gtk.org/pub/gtk/perl/ | while read FILENAME
do
 curl -vsSO ftp://ftp.gtk.org/pub/gtk/perl/$FILENAME
done

Curl says:

* About to connect() to ftp.gtk.org port 21
* Trying 128.32.112.248... connected
* Connected to ftp.gtk.org (128.32.112.248) port 21
< 220 Welcome to the GIMP.ORG FTP service.
> USER anonymous
< 331 Please specify the password.
> PASS curl_by_daniel_at_haxx.se
< 230 Login successful.
> PWD
< 257 "/"
* Entry path is '/'
* Remembering we are in dir pub/gtk/perl/Gnome-0.3000.tar.gz
* Connection #0 to host ftp.gtk.org left intact
* URL using bad/illegal format or missing URL
curl: (3) URL using bad/illegal format or missing URL
* Closing connection #0

Compare with wget:

curl -l ftp://ftp.gtk.org/pub/gtk/perl/ | while read FILENAME
do
 wget ftp://ftp.gtk.org/pub/gtk/perl/$FILENAME
done

--09:19:24-- ftp://ftp.gtk.org/pub/gtk/perl/Gnome-0.3000.tar.gz%0D
           => `Gnome-0.3000.tar.gz%0D'
Resolving ftp.gtk.org... 128.32.112.248
Connecting to ftp.gtk.org|128.32.112.248|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /pub/gtk/perl ... done.
==> PASV ... done. ==> RETR Gnome-0.3000.tar.gz\015 ...
No such file `Gnome-0.3000.tar.gz\015'.

As you can see, wget more clearly shows where the problem is.

 - Jeff
Received on 2006-04-11