cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: let curl automatically choose download for octet streams?

From: Jeff Pohlmeyer <yetanothergeek_at_gmail.com>
Date: Fri, 12 Mar 2010 13:53:25 -0600

On Fri, Mar 12, 2010 at 7:02 AM, Guenter wrote:

> I just faced again a usual stupid user error where I get a binary
> content displayed instead of stored ....

I feel your pain :-)

The two times when this bites me most often are:

  curl -C- http://example.com/file.bin

(It seems like that would tell curl to append the disk file,
but it doesn't.)

And this one:

  curl -O http://example.com/one.bin http://example.com/two.bin

(The first file goes to disk, the second one to the console)

Wow! I just discovered the --remote-name-all option, cool!

I don't know if changing the default behaviour after all these
years would be such a good idea, but maybe an additional option
like --write-binary-files-to-disk that could be placed in the
~/.curlrc would help, but then what would happen if e.g.
http://example.com/dir/ produces binary output? Should it fall back
to the console, or fail as in "Remote filename has no length" ?

But since the new --remote-name-all option can also work in concert
with -o, maybe I will think about just adding --remote-name-all to
my ~/.curlrc and see how that works out.

  - Jeff
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-12