From: Brian Candler Date: 2008-08-27T17:22:59+09:00 Subject: Re: open3 and background processes > I > thought there was a way to peek ahead on an IO object to see if any > data is available on the handle before attempting to read it You're probably thinking of Kernel.select. To poll if data is available for read on IO object foo, and read as much data is available, up to 1024 bytes max: if select([foo], nil, nil, 0) res = foo.readpartial(1024) end (select also returns true if the file is closed, in which case read will return nil) Beware of race conditions in your code - i.e. the child might not generate output on stderr until some time later, so you may need to continue to poll periodically.