[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Redirecting Octave IO
From: |
Richard Crozier |
Subject: |
Redirecting Octave IO |
Date: |
Fri, 04 Feb 2011 16:20:23 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.7) Gecko/20100713 Thunderbird/3.1.1 |
Hello,
I would like to use octave as a child process in a C#.NET application.
Basically I'm writing a little gui for octave. I can successfully
connect to octave and redirect stdin, stdout and stderr to streams in
C#. However, I have a problem that Octave does not always seem to send
the prompt to stdout, so I cannot tell if a computation has been completed.
For instance, if I set the octave prompt to be '>>' and I pass octave a
command which results in an output, e.g. 'x = 1\r' where '\r' is the
return character of course. I get back the string '>> x = 1'
However, if I pass in 'x = 1;\r' I get nothing immediately. At the next
input of a command that requires output however, I will then get a
string of prompts in the output stream.
e.g.
sending \r' followed by 'x = 1;r' followed by '\r' followed by 'x = 2\r'
will yield nothing in the ouput stream until after the last command when
I will get something like: '>> >> >> x = 2'
Is there any way to force octave to always send the prompts to the
output, i.e. replicating what happens when it is run in the normal way?
I have tried setting 'more off' and calling fflush(stdout) before and
after sending command strings but nothing seems to work. The biggest
problem is not knowing when octave is finished processing the last command.
Thanks
--
Richard Crozier, Research Associate
Institute for Energy Systems
School of Engineering and Electronics
The University of Edinburgh
Faraday Building, Room 4.124
The King’s Buildings
Edinburgh EH9 3JL
Phone: 0131 651 9023
Fax: 0131 650 6554
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
- Redirecting Octave IO,
Richard Crozier <=
- Re: Redirecting Octave IO, Jordi Gutiérrez Hermoso, 2011/02/04
- Re: Redirecting Octave IO, RC Crozier, 2011/02/05
- Re: Redirecting Octave IO, Jordi Gutiérrez Hermoso, 2011/02/05
- Re: Redirecting Octave IO, RC Crozier, 2011/02/06
- Re: Redirecting Octave IO, Laurent Hoeltgen, 2011/02/06
- Re: Redirecting Octave IO, Jordi Gutiérrez Hermoso, 2011/02/06
- Re: Redirecting Octave IO, Richard Crozier, 2011/02/07
Re: Redirecting Octave IO, Martijn, 2011/02/04