# Popen and bzip2

**URL:** <https://www.ruby-forum.com/t/popen-and-bzip2/86646>\
**Category:** Ruby\
**Created:** [February 24, 2007, 1:09am UTC](https://www.ruby-forum.com/t/popen-and-bzip2/86646 "2007-02-24T01:09:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [February 24, 2007, 1:09am UTC](https://www.ruby-forum.com/t/popen-and-bzip2/86646/1 "2007-02-24T01:09:02Z")

</div>

pipe = IO.popen(‘bzip2 -cd /home/dave/article.xml.bz2’, ‘r’)

always gives me:

bzip2: I/O or other error, bailing out. Possible reason follows.  
bzip2: Broken pipe  
Input file = /home/dave/article.xml.bz2, output file = (stdout)

when the program completes. I have tried pipe.close, pipe.close\_read. I  
can read lines from the pipe which is all i want to do, but I don’t get  
why this error is coming up.

Thanks!

Dave

---

<div class="post-metadata">

**Author:** ![dawillis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ebca7d/32.png) [@dawillis](https://www.ruby-forum.com/u/dawillis)\
**Post date:** [February 24, 2007, 1:59am UTC](https://www.ruby-forum.com/t/popen-and-bzip2/86646/2 "2007-02-24T01:59:56Z")

</div>

> always gives me:
> 
> bzip2: I/O or other error, bailing out. Possible reason follows.  
> bzip2: Broken pipe  
> Input file = /home/dave/article.xml.bz2, output file = (stdout)

Sorry I think this was my mistake. If I run it in Radrails I get this  
but on the cmd line I don’t have the problem so this may be an IDE  
artifact.
