| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-users Mailing List Archives
RE: Output to a file
From: Roth, Kevin P. <KPRoth_at_MarathonOil.com>
Date: Wed, 13 Nov 2002 08:44:35 -0500
One way to capture standard-error in your output file is this:
> curl.exe ...(your.arguments.here)... > out.txt 2>&1
The key piece is "2>&1", which redirects standard error (#2) into the same stream as standard out (#1).
I think there's also a command-line flag to turn this behavior on, but I'm not sure what it is.
Another option is to check the EXIT-CODE which curl.exe returns after it's done running. You can examine the batch variable ERRORLEVEL for this number, but be warned that it will change after you run another command. So capture it to your own variable (e.g. SET EXITCODE=%ERRORLEVEL%), and then if it's greater than 0, you had a problem of some kind. curl.exe --manual lists many of the exit codes by number, along with what they mean.
You can find more info on ERRORLEVEL by typing "help if" at a dos prompt under windows 2000.
--Kevin
-----Original Message-----
How is it possible to setup CURL such that to put the result of its operation into a file. I need this because I use curl to upload a file to an IP which is not always "on" - and i need to be sure that the file is uploaded. When the IP is "off", CURL just writes in the Command-Window "..could not resolve host.." - i would like to have this output into a file. I use Windows 2000.
-------------------------------------------------------
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info