On 26 April 2010 03:07, Olaf Till <olaf.t...@uni-jena.de> wrote:
> 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 ...

I am sorry. What I mean to say as that before I found that it required the
newline, I attempted to used fflush after fputs (without the newline), and
still didn't work. Only when I added the newline. For example

fputs(in, "message: hello") # Shows nothing
fflush(in)                  # Shows nothing
ffputs(in, "\n")            # Finally shows the message hello

> 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.

Buffered data? Does that mean that there's situations when octave doesn't
send data immediately?

The function will leave the pipe open, and returns an handle that can be
used to send more commands (or close it) later. If I got it right, then I
should flush the input pipe after using fputs just in case it got stuck,
unless I'm going to close it in which case there's no point.

Thanks for your help,
Carnẽ
------------------------------------------------------------------------------
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to