IO.pipe

P

Paulo Carvalho

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,269
Messages
2,571,338
Members
48,026
Latest member
DannieKeeg

Latest Threads

Top