# IO.pipe

**URL:** <https://www.ruby-forum.com/t/io-pipe/118039>\
**Category:** Ruby\
**Created:** [October 23, 2007, 2:55pm UTC](https://www.ruby-forum.com/t/io-pipe/118039 "2007-10-23T14:55:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crazybass](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@crazybass](https://www.ruby-forum.com/u/crazybass)\
**Post date:** [October 23, 2007, 2:55pm UTC](https://www.ruby-forum.com/t/io-pipe/118039/1 "2007-10-23T14:55:51Z")

</div>

Hello

I am having a problem with IO.pipe

I have the following code:

…  
img = read\_pipe.read()  
im = Magick::Image::read\_inline(Base64.b64encode(img)).first  
im.format = “PNG”  
puts “1”  
read\_pipe, write\_pipe = IO.pipe  
puts “2”  
im.write(write\_pipe)  
puts “3”  
write\_pipe.close()  
puts “4”  
…

My problem is that when i try to close the write\_pipe, the process seems  
to stop.  
In the console, I have the “puts ‘3’” printed but not the “puts ‘4’” and  
after that nothing happens.

Anyone with an idea about this problem?
