# How do I IO.read the entire thing

**URL:** <https://www.ruby-forum.com/t/how-do-i-io-read-the-entire-thing/121854>\
**Category:** Ruby\
**Created:** [December 2, 2007, 12:47am UTC](https://www.ruby-forum.com/t/how-do-i-io-read-the-entire-thing/121854 "2007-12-02T00:47:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [December 2, 2007, 12:47am UTC](https://www.ruby-forum.com/t/how-do-i-io-read-the-entire-thing/121854/1 "2007-12-02T00:47:57Z")

</div>

I have a system command that im running using Popen. Im trying to read  
in the entire io result. IO.read needs a length argument to run.

How can I read it without knowing what the total length is?

---

<div class="post-metadata">

**Author:** ![ericgoodwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/c68b51/32.png) [@ericgoodwin](https://www.ruby-forum.com/u/ericgoodwin)\
**Post date:** [December 2, 2007, 2:01am UTC](https://www.ruby-forum.com/t/how-do-i-io-read-the-entire-thing/121854/2 "2007-12-02T02:01:09Z")

</div>

From: “Aryk G.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> I have a system command that im running using Popen. Im trying to read  
> in the entire io result. IO.read needs a length argument to run.
> 
> How can I read it without knowing what the total length is?

Omit the length parameter. (ri IO#read)

everything = io.read

Regards,

Bill
