Rubyw and stdout


#1

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?


#2

rubyscript2exe suggests this:

----- Original Message ----
From: Mark V. removed_email_address@domain.invalid
To: ruby-talk ML removed_email_address@domain.invalid
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?


#3

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>


#4

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. removed_email_address@domain.invalid
To: ruby-talk ML removed_email_address@domain.invalid
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?