cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Making runtests.pl more talkative when unable to find out curl's version

From: Yang Tse <yangsita_at_gmail.com>
Date: Wed, 7 Dec 2005 03:13:45 +0100

Hey,

When we try to get Curl's version we are also interested in the stderr
output produced if the command fails.

Trying to load an array, using backticks, with stdout while having
stderr redirected to a file has proven ineffective on all three
platforms that we were specially interested, so we must do it in a
more simple way, which works on all perl's versions and platforms.

The attached patch does this in the following manner:

First it uses perl's system() command to redirect both stdout and
stderr to different files, when executing 'curl --version'.

In second place it opens the already written file into which stdout
has been redirected and loads the version array with its contents, if
any.

And third, if the command has failed it shows the contents of the
already written file into which stderr has been redirected.

Regards,
Yang

Received on 2005-12-07