From: Holden Glova Date: 2000-12-28T16:10:43+09:00 Subject: [ruby-talk:8161] $stderr redirection -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, How would I go about redirecting $stderr in a platform independent fashion? Currently I am running ruby -c against a source file within backquotes. The problem is that when the syntax check is in error, it seems to display the output to stderr. I need to grab that output as the return value from my method. Here is an example of what I have, which works just fine for a "Syntax OK" response. class SyntaxInterpreter def invoke(file) `ruby -c #{file}`.chop! end end Any thoughts or suggestions about how to do this would be very welcome. Would I be correct in thinking that a IO.pipe() might be the trick, or not? Although this solution claims in the pickaxe book to not be platform independent :( - -- Signed, Holden Glova -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE6Sub9zrxa+Gy/b/4RAp49AKCKfJ3DiyzvCFDy7WYY4aHdppQQhQCfQBp8 sEQAYjzEYkat90mWWgYCk+c= =BQPW -----END PGP SIGNATURE-----