help-octave
[Top][All Lists]
Advanced

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

octave > FIFO


From: John W. Eaton
Subject: octave > FIFO
Date: Sun, 25 May 1997 23:16:18 -0500

On 25-May-1997, Ted Harding <address@hidden> wrote:

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

| Otave example:
| --------------
| 
| In the directory octave is running in, do
| 
|     mkfifo temp
| 
| Now fprintf("temp",FORMAT, args) looks tempting, but octave says
| 
|     error: fprintf: invalid file type

The idea is right, but you need to open the FIFO first.  If you try

  fid = fopen ("temp", "w");
  fprintf (fid, FORMAT, args);
  fflush (fid);

it should work.  Also, if your system supports FIFOs, you should be
able to create and delete them directly within Octave:

  mkfifo ("fifo-file");

    ## Do operations with fifo-file ...

  unlink ("fifo-file");


jwe


reply via email to

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