[Eventmachine-talk] How to keep a pipe open

Duane Johnson
2007-11-27T14:49:57Z

Hi all,

I''ve been reading what I can from the list regarding
EventMachine::popen.  The following two messages were helpful (for
anyone else trying to use it):

http://rubyforge.org/pipermail/eventmachine-talk/2007-June/000747.html
http://rubyforge.org/pipermail/eventmachine-talk/2007-November/
001227.html

My question is this: How do I keep a pipe open for interactive-shell-
type commands that "hang up"?

I''m not sure I totally understand the mechanisms in place that are
causing this, so please feel free to chime in with obvious answers
here.  As an example of the problem, take "TeX":

> EventMachine::run do
>   EventMachine::popen("tex -ipc", TexInstance)
> end

This results in the following output (TexInstance simply forwards
what it receives):

received: This is TeX, Version 3.141592 (Web2C 7.5.6)
received: **
received: ! End of file on the terminal... why?

This is the exact same message I receive if I start tex up and hit
"ctrl-d" on the keyboard... so by its appearance, it seems like my
pipe is closing because tex is receiving an end-of-file character.

Any ideas or workarounds?  Thanks!

Duane Johnson
-------------- next part --------------
An HTML attachment was scrubbed...