cURL / Mailing Lists / curl-users / Single Mail

curl-users

Why the range begin from 0 instead of 1?

From: Hongyi Zhao <hongyi.zhao_at_gmail.com>
Date: Mon, 11 May 2015 08:24:04 +0800

Dear Daniel,

In the curl's manpage, I can read the following the description on the
range option of curl:

 -r, --range <range>
          (HTTP/FTP/SFTP/FILE) Retrieve a byte range (i.e a partial docu‐
           ment) from a HTTP/1.1, FTP or SFTP server or a local FILE.
           Ranges can be specified in a number of ways.

            0-499 specifies the first 500 bytes

I just wondered why not use 1, instead of 0, as the beginning counter
of the bytes number of a file?

If so, the above usage will looks like this:

1-500 specifies the first 500 bytes

It seems that this is more consistent with the concept of `the first
500 bytes' of a file.

Any hints on this?

Regards

-- 
Hongyi Zhao <hongyi.zhao_at_gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493
-------------------------------------------------------------------
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 2015-05-11