cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Wrong file status if downloaded is continued

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 7 Oct 2010 20:04:32 +0200 (CEST)

On Thu, 7 Oct 2010, Abhijeet Rastogi wrote:

>     The files have different STAT when download is paused.

You don't "pause", you stop the download and make another resumed download
again later.

> shadyabhi_at_ArchLinux /tmp $ curl --range 0-40000 -C -

curl should probably warn you about this, but what exactly are you asking
here? A range or resume from? --range and -C are at least partly mutually
exclusive and I don't understand what you want it to do.

> ** Resuming transfer from byte position 20480

See, the first download got 20480 bytes when you stopped it and now it
continues there. The -C has effect, the --range is ignored/overridden.

>  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
>                                 Dload  Upload   Total   Spent    Left  Speed
> 100 36544  100 36544    0     0   1988      0  0:00:18  0:00:18 --:--:--  3769

... so it downloaded 36544 bytes in the second download.

>  Size: 57024           Blocks: 112        IO Block: 4096   regular file

Exactly. 20480 + 36544 = 57024

> So, size is 57024 which should be 40001 as I downloaded only that much data.

You may have wanted to only download that, but you didn't ask for only that.

-- 
  / 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 2010-10-07