cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: aborted download should be retried

From: Nielsen Linus (ext) <Linus.Nielsen_at_elema.siemens.se>
Date: Mon, 11 Feb 2002 12:56:02 +0100

> Dear Daniel,

Daniel is on a skiing trip, and will be back next week.

> do you have any tips for me how to get started scripting that
> with winnt?

I have a small suggestion. Here is a BAT file that retries the download
until it succeeds. That is when curl.exe returns 0.

:retry
curl http://mysite.com/myfile.html
if ERRORLEVEL 1 GOTO retry

> Are there any specific return codes which i should check for?

In the above case, everything but 0 retries the download.

> How do i know if a download was successfull/failed or the network is down?

The return codes will be different. I don't know all the return codes, but
you can find them in the source code. Then you will have to use several "if
errorlevel" statements to cover the different cases.

Good luck!

/Linus
Received on 2002-02-11