Forum: Ruby rubyw and stdout

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.
52a177e9dbd3e614825aabc4e45f8cd6?d=identicon&s=25 Mark Volkmann (Guest)
on 2006-06-08 16:34
(Received via mailing list)
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?
Da914f265213ce31c7d22195ef178d15?d=identicon&s=25 Gordon Thiesfeld (Guest)
on 2006-06-08 16:37
(Received via mailing list)
rubyscript2exe suggests this:


----- Original Message ----
From: Mark Volkmann <r.mark.volkmann@gmail.com>
To: ruby-talk ML <ruby-talk@ruby-lang.org>
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?
Da914f265213ce31c7d22195ef178d15?d=identicon&s=25 Gordon Thiesfeld (Guest)
on 2006-06-08 16:40
(Received via mailing list)
sorry, hit send by accident.

Anyway,  rubyscript2exe suggests doing this:

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

----- Original Message ----
From: Mark Volkmann <r.mark.volkmann@gmail.com>
To: ruby-talk ML <ruby-talk@ruby-lang.org>
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?
Da914f265213ce31c7d22195ef178d15?d=identicon&s=25 Gordon Thiesfeld (Guest)
on 2006-06-08 16:50
(Received via mailing list)
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>
This topic is locked and can not be replied to.