[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

system() help

zac elston

2/21/2006 8:27:00 PM

are there any docs describing how to get stderr vs stdout from a
system()?

@myresult = system(mycmd)
works only if I have stdout returned but not stderr.

thanks

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


2 Answers

Eero Saynatkari

2/21/2006 8:32:00 PM

0

zac elston wrote:
> are there any docs describing how to get stderr vs stdout from a
> system()?
>
> @myresult = system(mycmd)
> works only if I have stdout returned but not stderr.

You might want to look at IO.popen or Open3 from the
stdlib (Open3.popen) if you need anything more than
your platform's C system() call.

> thanks


E

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


matt.smillie@gmail.com

2/21/2006 8:35:00 PM

0

Look up 'open3' in the standard library:
http://ruby-doc.org/stdlib/libdoc/open3/rdoc/...

require "open3"
stdin, stdout, stderr = Open3.popen3('man ruby')

(You don't have to use stdin if you don't want to)