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.

Hi Bill,

> Does running the command like this work for you?
> 
> watir-check.rb | tee console.log

No, same problem.

> 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.

I am using gnuwin32 for other things where it works ok. I just tried 
Cygwin's tee (in cmd.exe ...) and I still have the same problem.

>> Still the same problem. I tried to simplify even more:
>>
>>   ruby watir-check.rb > watir-check.tmp
>>
>> To my surprise not even this worked.
> 
> Odd, this should work.  Are you running the command manually in the
> console window, or is another script/program executing the command?

Manually.

> If all else fails, another (more complicated) way to do this is to
> write a little Ruby script that runs your Watir script using IO.popen,
> and uses the resulting IO object to read the standard output of the
> Watir script.  The parent script can then do anything it wants with
> the output; in my case I wrote it to a file.  When I tried saving the
> output of Watir scripts this way, it worked fine (although I've seen
> complaints about the reliability of Ruby's popen method on win32).

That would nearly be a Ruby tee, wouldn't it? Thanks for the suggestion.

> But resorting to that shouldn't be necessary; hopefully you can get
> the tee.exe technique working.

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to