cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Use of -O -J -D

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 24 May 2012 09:30:25 +0200 (CEST)

On Thu, 24 May 2012, Tatsuhiro Tsujikawa wrote:

> When running curl with -O -J -D header.txt, curl creates header.txt but it
> is empty.
>
> $ curl -O -J -D header.txt http://curl.haxx.se/download/curl-7.25.0.tar.gz
>
> Is this by design or bug?

I would say it is a bug.

> If it is the bug, then the possible fix is extend tool_headr_cb and inside
> the function, check config and do content-disposition check and header dump.
> Defining some storage structure is handy here like this:

Yes I think so, it just mustn't detroy what -i does. "curl -O -J -i [URL]"
would include the headers in the output file name.

Care to send a patch for this?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-05-24