[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Blocking I/O to gnuplot pipe
From: |
John W. Eaton |
Subject: |
Re: Blocking I/O to gnuplot pipe |
Date: |
Sat, 15 Feb 2003 17:15:06 -0600 |
On 15-Feb-2003, David Bateman <address@hidden> wrote:
| The replot problem however will be a real pain. I think the solution Andy
| suggested is the best, since at least it is consistent with what is done
| with a straight gplot call.
Since you are writing to a temporary file, perhaps we need a
function that generates a unique temporary file name, opens it, and
adds the name to the list of files marked for deletion.
I've added the following functions to the CVS archive. I think
mkstemp might help.
- Built-in Function: [FID, NAME, MSG] = tmpfile (TEMPLATE, DELETE)
Return the file ID corresponding to a new temporary file with a
unique name created from TEMPLATE. The last six characters of
TEMPLATE must be `XXXXXX' and tehse are replaced with a string
that makes the filename unique. The file is then created with
mode read/write and permissions that are system dependent (on
GNU/Linux systems, the permissions will be 0600 for versions of
glibc 2.0.7 and later). The file is opened with the `O_EXCL' flag.
If the optional argument DELETE is supplied and is true, the file
will be deleted automatically when Octave exits, or when the
function `purge_tmp_files' is called.
If successful, FID is a valid file ID, NAME is the name of the
file, and and MSG is an empty string. Otherwise, FID is -1, NAME
is empty, and MSG contains a system-dependent error message.
- Built-in Function: [FID, MSG] = tmpfile ()
Return the file ID corresponding to a new temporary file with a
unique name. The file is opened in binary read/write (`"w+b"')
mode. The file will be deleted automatically when it is closed or
when Octave exits.
If successful, FID is a valid file ID and MSG is an empty string.
Otherwise, FID is -1 and MSG contains a system-dependent error
message.
jwe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------