help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invoke an octave session via pipe


From: Jaroslav Hajek
Subject: Re: Invoke an octave session via pipe
Date: Thu, 7 May 2009 21:19:08 +0200

On Thu, May 7, 2009 at 7:29 PM, Qianqian Fang <address@hidden> wrote:
>
> I am trying to run a simple octave script I wrote from a GUI. The GUI was
> written in free pascal with Lazarus. I created a process for "octave" using
> pipes, and sent commands to the octave session via stdin, and tried to read
> the output from stdout. Unfortunately, my program did not work. Octave was
> started correctly, and from stdout, I could capture the copyright info
> printed at the beginning of an octave session. However, this message ended
> at "... from previous versions, type `news'", and I can not read from the
> output pipe anymore. Sending a new command also did not give me a new buffer
> to read.
>
> My question is: is this the correct way to invoke octave from another
> program? if octave directs its output not to stdout, then which pipe it
> should be?
>
> My full test unit can be found at the following link:
> http://forum.lazarus.freepascal.org/index.php/topic,6693.0.html
>
> any suggestions are appreciated, thanks in advance.

When writing to a pipe you typically need to flush it afterwards to
ensure the other process actually gets the data. It seems your code
doesn't do it, so unless FreePascal flushes automatically, which I
doubt, I would try that. No idea of the syntax in Pascal, but you'll
probably figure out.

regards

-- 
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]