cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Using options -C and -z

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 3 Mar 2011 11:44:11 -0800

On Thu, Mar 03, 2011 at 02:26:38PM +0100, Gabriel Thörnblad wrote:
> I would have hoped that if curl realizes that the remote file is
> newer than the local, it would discard the "-C" option and restart
> the download from byte 0. Unfortunately for me, curl now tries to
> resume from the last position in the local(older) file and corrupts
> my download.
>
> Have I misunderstood something, or am I trying to use curl in ways it
> was not intented?

curl is doing exactly what was requested of it :-) This kind of situation
would be exactly what someone else might need to, for example, download
log files that are appended to but never overwritten. It sounds like you'll
have to do this operation in two steps; check the date, and then download
only if it doesn't match. HTTP doesn't provide any way to do what you
want in a single operation, anyway, so this is what would have to happen
in curl, regardless.

>>> Dan
-------------------------------------------------------------------
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 2011-03-03