Closing files opened with Open3.popen

Is there anyway to close a file that I opened with Open3.popen ? I’m
running a lot of external process (and capturing their stderr), but if
the process runs too long eventually I get a "Too many open files"
error.

Francis

not sure i understand but:

~ > ruby -r open3 -e ‘ios = Open3::popen3 “sh”; system “ps”; ios.map{|io| io.close}; system “ps”’

PID TTY TIME CMD
5379 pts/5 00:00:00 bash
6681 pts/5 00:00:00 ruby
6683 pts/5 00:00:00 sh
6684 pts/5 00:00:00 ps

PID TTY TIME CMD
5379 pts/5 00:00:00 bash
6681 pts/5 00:00:00 ruby
6685 pts/5 00:00:00 ps

-a

···

On Tue, 1 Jun 2004, Francis Hwang wrote:

Is there anyway to close a file that I opened with Open3.popen ? I’m running
a lot of external process (and capturing their stderr), but if the process
runs too long eventually I get a “Too many open files” error.

Francis

EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
A flower falls, even though we love it; and a weed grows, even though we do
not love it. --Dogen
===============================================================================

Use IO#close.

Paul

···

On Wed, Jun 02, 2004 at 11:28:38AM +0900, Francis Hwang wrote:

Is there anyway to close a file that I opened with Open3.popen ? I’m
running a lot of external process (and capturing their stderr), but if
the process runs too long eventually I get a “Too many open files”
error.