# IO.pipe

**URL:** <https://rubytalk.org/t/io-pipe/41600>\
**Category:** ruby-talk\
**Created:** [23 October 2007 12:55 UTC](https://rubytalk.org/t/io-pipe/41600 "2007-10-23T12:55:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paulo\_Carvalho](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@Paulo\_Carvalho](https://rubytalk.org/u/Paulo_Carvalho)\
**Post date:** [23 October 2007 12:55 UTC](https://rubytalk.org/t/io-pipe/41600/1 "2007-10-23T12:55:50Z")

</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?

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
