[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: system() help

Berger, Daniel

2/21/2006 8:44:00 PM



> -----Original Message-----
> From: matt.smillie@gmail.com [mailto:matt.smillie@gmail.com]
> Sent: Tuesday, February 21, 2006 1:39 PM
> To: ruby-talk ML
> Subject: Re: system() help
>
>
> 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)

Use the block form. :)

Open3.popen3('man ruby'){ |stdin, stdout, stderr|
...
}

Closes the blocks automatically for you.

Regards,

Dan