Stephan Wehner wrote:
> However, the output of the puts / puts line at the end of
> the process method does not occur at the places I expect.
> 
> The output of "some_executable" for several "lines" shows up on STDOUT,
> then the output of the puts / puts line for several "lines" shows up on
> STDOUT, whereas they should simply alternate (depending on the "line"
> value).
> 
> Am I missing something about pipes, and how the input/output streams are
> hooked up?

  This has nothing to do with pipes. Ruby is buffering output streams:
the executed command necessarily flushes its output when it terminates
but nothing in Ruby guarantees that the buffer in the (Ruby) stream will
be flushed before the start of the next command.

  I'll try to make it more clear: the buffering is done within Ruby, so
the underlying operating system knows nothing about the two lines you
want to output, and happily just writes what the next executed commands
writes.

  Hope this helps,

	Vincent
--
Vincent Fourmond, Doctor in Physics
http://vincent.fourmond.neuf.fr/