[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

access contents of the output windows

Junkone

12/24/2007 10:47:00 AM

hello
I am running this as a separate thread.
system("start E:\\TradingTools\\IBController\IBControllerStart_customised.bat")

how can i access the stdout of this tread- basically capturing all the
data streaming out of this dos window of this batch file exectuion.
thaks in advance
2 Answers

Matthew Harris

12/24/2007 11:41:00 AM

0

Junkone wrote:
> hello
> I am running this as a separate thread.
> system("start E:\\TradingTools\\IBController> \IBControllerStart_customised.bat")
>
> how can i access the stdout of this tread- basically capturing all the
> data streaming out of this dos window of this batch file exectuion.
> thaks in advance
>
>
>
Hi.
You can try using IO.popen (`ri IO.popen` from the command line) or try
installing the win32-open3 gem, which allows you to easily pipe standard
input, standard output and standard error into separate I/O pipes.

--
Matthew Harris
http://matthew...


Siep Korteling

12/24/2007 12:01:00 PM

0

Junkone wrote:
> hello
> I am running this as a separate thread.
> system("start E:\\TradingTools\\IBController> \IBControllerStart_customised.bat")
>
> how can i access the stdout of this tread- basically capturing all the
> data streaming out of this dos window of this batch file exectuion.

Maybe this works for you:
output = `start
E:\\TradingTools\\IBController\\IBControllerStart_customised.bat`

Note the " ` ", it's a backtic, not a single quote (" ' ").

see http://www.ruby-...to...
--
Posted via http://www.ruby-....