From: gwtmp01@... Date: 2005-06-28T06:21:20+09:00 Subject: Re: redirecting STDOUT On Jun 27, 2005, at 4:52 PM, Joe Van Dyk wrote: > Nevermind, it does work! > > My test application was the following Ruby application: > > #!/bin/env ruby > while true > puts "pid: #{Process.pid}, time: #{Time.now}" > sleep 0.2 > puts > end > > Does #puts not write to STDOUT by default? Buffering. When you run this program with output associated with the terminal, STDOUT is line buffered so you see each line right after puts executes. When you redirect STDOUT to a file, the IO is not line buffered but instead buffered into blocks. When I tested your program, I didn't see any output in the file until puts had generated 4k worth of data at which point it was flushed to the file system. You'll have to put in explicit calls to flush if you expect to see the output in a different way or change STDOUT to be line buffered. Gary Wright