Rubyw and stdout

If you run a script with rubyw under Windows and the script writes to
stdout, is there a way to capture that output without modifying the
script? Is there a rubyw option for specifying where the output should
go?

rubyscript2exe suggests this:

----- Original Message ----
From: Mark V. [email protected]
To: ruby-talk ML [email protected]
Sent: Thursday, June 8, 2006 9:31:26 AM
Subject: rubyw and stdout

If you run a script with rubyw under Windows and the script writes to
stdout, is there a way to capture that output without modifying the
script? Is there a rubyw option for specifying where the output should
go?

I just noticed that you want to do this without modifying the script.
This would be a better way to do it then.

c:\rubyscripts>rubyw test.rbw > test.log
c:\rubyscripts>

sorry, hit send by accident.

Anyway, rubyscript2exe suggests doing this:

$stdout = $stderr = File.new(“/path/to/temp/application.log”, “w”)

----- Original Message ----
From: Mark V. [email protected]
To: ruby-talk ML [email protected]
Sent: Thursday, June 8, 2006 9:31:26 AM
Subject: rubyw and stdout

If you run a script with rubyw under Windows and the script writes to
stdout, is there a way to capture that output without modifying the
script? Is there a rubyw option for specifying where the output should
go?