cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: --stderr in curl 7.9.3 for win32

From: lsi <stuart_at_cyberdelix.net>
Date: Sat, 16 Mar 2002 03:47:37 -0000

Hi folks :)

> > when I try to use this parameter, all output goes to the file, not just errors ...

> That is correct, all writes to stderr are instead directed to the given file.
> The progress meter output is sent to stderr.

What I wanted to do was see the progress indicator onscreen, and have any errors recorded in a file.

If there was a switch to send progress indicator output to stdout (only works if -O also used), then all would
be fine and dandy.

> We pass contents to stdout when -O isn't used, and we still like the progress
> meter to work for those cases so we can't write it to stdout too.

If -O is used, then the progress indicator can be safely sent to stdout, the content to file, and errors to stderr
(which may or may not be redirected by --stderr).

> For example, when doing things like this:
>
> $ curl http://daniel.haxx.se/huuuugefile | ./eat-big-files.sh

Using this commandline:

curl -O ftp://ftp.netscape.com/cc32d479.exe --stderr
myfile.txt

will currently produce a large myfile.txt (containing lots of progress indicator data), which *may* contain an
error at the end of the file (slow to search). Also, no onscreen output will be visible, despite the transfer
potentially taking a long time.

Adding a switch to send the progress indicator to stdout will mean myfile.txt is only created if there is an
error, and any errors will be at the top of the file - and it will mean a progress indicator is visible onscreen,
should no error occur. This makes more sense to me!

Please don't ask why I can't detect curl's exit codes. :)

Stuart

-- 
Stuart Udall
stuart@cyberdelix.net - http://www.cyberdelix.net/
..revolution through evolution
want to make some cash? check out http://cyberdelix.net/affiliates.htm
Received on 2002-03-16