cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-users Mailing List Archives

RE: detect if an upload/download is finished or failed

From: Roth, Kevin P. <KPRoth_at_MAPLLC.com>
Date: Mon, 12 Jan 2004 11:00:55 -0500

Interesting code, but just be aware that it ONLY works on Win95 or Win98 (and perhaps Win ME).

It breaks on Win2000 because the value of ERRORLEVEL gets reset by the first FOR statement. WinNT users and up (Win2k, WinXP, Win2003 etc) should take advantage of the "built-in" (to the windows command shell) %ERRORLEVEL% environment variable, and also the built-in math functions (e.g. IF %ERRORLEVEL% GTR 5 would ask whether errorlevel is Greater Than 5) or a GOTO type statement (e.g. GOTO handle_%ERRORLEVEL% which would jump to a label such as :handle_6).

- Kevin

-----Original Message-----
From: Sebastien WILLEMIJNS
Sent: Saturday, January 10, 2004 9:53 AM

FYI, i have found a batch program who show errorlevel code on win9x,
it's errlvlp.zip who is available on FILELIBRARY ;)

when i want someone, i'll give you ;) but it was VERY hard to find it

=======================================
SET N=
curl http://non-existant-domain.com/index.php
FOR %%A IN (0 1) DO IF ERRORLEVEL %%A00 SET N=%%A
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %N%%%A0 SET N=%N%%%A
FOR %%A IN (0 1 2 3 4) DO IF ERRORLEVEL 2%%A0 SET N=2%%A
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %N%%%A SET N=%N%%%A
FOR %%A IN (0 1 2 3 4) DO IF ERRORLEVEL 25%%A SET N=25%%A
ECHO.
ECHO ERRORLEVEL IS %N%
==========================

-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
Received on 2004-01-12

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET