cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: let curl automatically choose download for octet streams?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 14 Mar 2010 23:55:46 +0100 (CET)

On Fri, 12 Mar 2010, Guenter wrote:

>> thought that we could at least if we get a header 'octet stream' which
>> clearly identifies binary content automatically imply -O so the content
>> gets stored to a file instead of displayed to stdout; or am I missing
>> something? Is this a bad idea?

> ok, bad sample above since for ftp we can probably dont do such since we get
> no headers at all IIRC, but I was more thinking of http when I wrote this

(Strictly speaking this is a subject for the curl-users list...)

Since this suggestion would break how existing curl works and thus will be
surprising to users at best and ruining working setups at worst, I'm basically
against it. Further: I don't think we now can assume that "Octet stream" is
always wanted to get saved as binary, and more: you won't see a lot of headers
like that. You would basically need to instead do something more crazy
and treat everything that isn't "text/*" or "html/*" to be binary, or
something similar. Error-prone, nonetheless.

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