[Eventmachine-talk] How to keep a pipe open

Duane Johnson
2007-11-27T23:58:07Z

What kind of process would you suggest?  I tried "telnet" and the
result was different: there was no "hang up"... but then again, ctrl-
d sent to telnet on the shell does nothing either.

The ruby program does not terminate in the case of popen("tex",
TexInstance).  The pipe closes but the ruby program remains running
in the EM run loop.

Duane

On Nov 27, 2007, at 8:02 PM, Roger Pack wrote:

> Maybe try it with a process where you can see what it receives more
> easily?  Maybe the process is being interrupted...is your ruby program
> terminating?
> Take care.
>
> On Nov 27, 2007 3:49 PM, Duane Johnson <canadaduane at gmail.com>
wrote:
>> 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
>> _______________________________________________
>> Eventmachine-talk mailing list
>> Eventmachine-talk at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/eventmachine-talk
>>
>
>
>
> --
> -Roger Pack
> For God hath not given us the spirit of fear; but of power, and of
> love, and of a sound mind" -- 2 Timothy 1:7
> _______________________________________________
> Eventmachine-talk mailing list
> Eventmachine-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/eventmachine-talk