Forum: Ruby Standard error redirection in backquote notation

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Vincent Lambert (Guest)
on 2009-02-25 19:27
(Received via mailing list)
Hello,

We want to capture all the output of an external program that we call
from ruby. We use a custom function that sends the command to the system
using the backquote notation. 2>&1 is appended at the end of the command
line to capture the standard error (which is very important to us). When
we add 2>&1, we get the following error messages : 'c:\Program' is not
recognized as an internal or external command. Note that we get this
error even when the command is surrounded by quotes.

Do you have any idea how to get around this problem ?
We are using Windows XP.

Any help would be greatly appreciated.
This topic is locked and can not be replied to.