Forum: Ruby Re: system() help

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-02-21 22:46
(Received via mailing list)
> 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
This topic is locked and can not be replied to.