Platform independent piped input stream from system call

Hi all,
I want to get an input stream from a system command in this manner:

f = open("|ls")
while( [not end of output] )
f.gets
end

but I would like it to be platform independent. The output of the
command I’ll be using is massive (hundreds of GB) so I cannot load to
memory or write to a temp file. Is there a good platform-independent way
to do this?

Thanks!

Danny.

On 12/29/2010 12:10 PM, Danny C. wrote:

memory or write to a temp file. Is there a good platform-independent way
to do this?

Check out IO.popen:

http://rdoc.info/stdlib/core/1.9.2/IO.popen

-Jeremy

That is exactly what I was looking for! Thank you for pointing me in
the right direction!

Jeremy B. wrote in post #971324:

On 12/29/2010 12:10 PM, Danny C. wrote:

memory or write to a temp file. Is there a good platform-independent way
to do this?

Check out IO.popen:

http://rdoc.info/stdlib/core/1.9.2/IO.popen

-Jeremy

Danny C. wrote:

That is exactly what I was looking for! Thank you for pointing me in
the right direction!

And if that was good, this might be even better:

k