On Mon, Apr 26, 2010 at 02:46:00AM -0400, Carnë Draug wrote:
> On 26 April 2010 02:18, Olaf Till <olaf.t...@uni-jena.de> wrote:
> > May be, but also after each command you want to be sent over the pipe
> > just now, you should:
> >
> > fflush (in);
> >
> I did try that but it still didn't make the message appear.

This should be due to the other process and the commands you sent to
it. Double check that the end-of-line you spoke of was present ...

> However,
> when I was reading the help texts, it said it was a good idea to do it
> before reading from output. Since this is for a function in
> octave-forge, I'm guessing I should make the function do it before it
> returns. Is this right?

fflush causes all possibly buffered data to be sent over the pipe at
once. This is automatically done if you close the pipe, so there is no
need to call fflush before that. The cited help text probably means
that if you expect some output from the process at the far end of the
pipe, that process should have received your commands which lead to
the output, so you should call fflush on its input pipe before reading
its output pipe.

> Is there any other thing that I should pay attention?

If you read from the output pipe of the other process, this pipe
should have been flushed before, too. The other process must be made
to do that.

Olaf

------------------------------------------------------------------------------
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to