cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to let curl to skip a already finished file when using the -C - option.

From: Hongyi Zhao <hongyi.zhao_at_gmail.com>
Date: Mon, 6 Apr 2015 14:50:09 +0800

Hi all,

The curl manual said that:

 Use "-C -" to tell curl to automatically find out where/how to resume
the transfer. It then uses the given output/input files to figure
that out.

So I tried the following command to test it:

curl -C - -O http://ftp.cn.debian.org/debian/dists/Debian7.8/Release

The issue is:

If the file doesn't exist or the file is leaving from the previous
aborted transferrings, this command can give the correct result file.

But, if the file already has been downloaded successfully, the above
command will append something like this behind the file's end:

--------
<html>
<head><title>416 Requested Range Not Satisfiable</title></head>
<body bgcolor="white">
<center><h1>416 Requested Range Not Satisfiable</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
--------

As you can see, in this case, the curl give a error result based on its
judgment of where/how to resume the transfer.

So, how to let curl automatically skip the downloading for this case?

Is this possiable?

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-04-06