16 Apr '12, 9am

Ruby Setting $stdout per-thread $stdout vs STDOUT via @luislavena

drbrain | Thu, 17 Aug 2006 16:47:00 GMT Posted in Ruby You may have noticed me using both $stdout and STDOUT in my last post and been puzzled by how I could use both. When Ruby starts up the process’ standard output file descriptor is stored in both the constant STDOUT and the global variable $stdout. STDOUT holds the process’ original stdout while $stdout is reassignable. Kernel#puts and friends use $stdout to write their output, not STDOUT . To be most-friendly, when you want to redirect stdout you should assign to $stdout instead of fiddling with STDOUT . When outputting to an explicit file descriptor, use $stdout or $stderr instead of STDOUT or STDERR . STDOUT can only be changed by calling IO#reopen, but you can assign any object that responds to #write to $stdout, which is what made my ThreadOut hack work.

Full article: http://blog.segment7.net/2006/08/17/stdout-vs-stdout

Tweets

Setting $stdout per-thread via @zite

blog.segment7.net 16 Apr '12, 9am

drbrain | Wed, 16 Aug 2006 18:58:00 GMT Posted in Hacking , Ruby cdfh on #ruby-lang asked how to redirect $stdout per-thre...

Singtel vs M1 vs Starhub: Who has the best reception on trains?

Singtel vs M1 vs Starhub: Who has the best rece...

singaporeseen.stomp.com.sg 15 Apr '12, 6am

StarHub: 'We apologise if our promotion was deemed insensitive' Unfair that expats get better deal with StarHub's UEFA Eur...