Lennart Borgman (gmail) wrote: > Bill Agee wrote: >>> watir-check.rb 2>&1 | tee watir-check.tmp >>> >>> I am using Windows XP so this is run in cmd.exe, but it normally works >>> with this syntax. (tee.exe is from gnuwin32.) >>> >>> This did not work, the .tmp file is created but is empty and I see >>> nothing in the console window. >> Does running the command like this work for you? >> >> watir-check.rb | tee console.log >> >> I'm using WinXP and Cygwin's tee.exe. If I run scripts in the above >> fashion, I get the desired behavior - the script output shows up in >> the cmd.exe window and console.log at the same time. > > > Forgot to ask you: what version of Ruby are you running? Mine says > > C:\rubytest\ie>ruby --version > ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
I think I understand what is happening now. It is buffering. I did not notice, since I let the program ran for long time in a loop and interrupted it later (with Control-C). After some googling I inserted STDOUT.flush and this cured the problem. _______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general