[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
octave > FIFO
octave > FIFO
Sun, 25 May 1997 13:54:23 +0100 (GMT+0100)
I want to write from octave to a FIFO (named pipe). What is the best way
to do this? It doesn't seem to be straightforward.
Now go to another window (but the same directory) and execute
cat < temp
Back in to first window, execute
cat > temp
(terminating with Ctrl-D). The lines typed in on screen 1 will be
displayed on screen 2 after their newlines are entered.
Having closed the stream with ^D, you can start a new stream in the same
way, from the same or a different wndow (the FIFO remains in place).
In the directory octave is running in, do
Now fprintf("temp",FORMAT, args) looks tempting, but octave says
error: fprintf: invalid file type
However, the line
system("echo STUFF > temp")
works just fine. The only thing is, you don't want to send anything
complicated this way. It would be nice to have the formatting flexibility
Any good suggestions?
The real reason I'm looking into this is not to do anything so naive as
the above examples.
Once some FIFOs have been created, other programs can read from them at
will, moving from one to another if need be. Octave can similarly write
different streams of output, line by line, to them. This offers a very
flexible interface between octave and a suite of external programs.
Who knows? It may even have something to do with recent discussions.
Bes wishes to all,
- octave > FIFO,
Ted Harding <=