[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FW: What does imagesc.m need?
From: |
Andy Adler |
Subject: |
Re: FW: What does imagesc.m need? |
Date: |
Wed, 3 Mar 2004 07:14:27 -0500 (EST) |
> on 2/28/04 1:53 PM, Paul Kienzle at address@hidden wrote:
> > Here's an example using peaks.m from octave-forge:
> >
> > colormap(hot);
> > M=imagesc(peaks(40));
> > bmpwrite(M,hot,'/tmp/junk.bmp');
> > system('open /tmp/junk.bmp; sleep 1; rm -f /tmp/junk.bmp');
> >
> > Note the 'sleep 1; rm -f /tmp/junk.bmp' which waits a bit so that
> > the file has a chance to load, then removes it.
One way to deal with the 'rm' is to use 'mark_for_deletion'
from octave-forge. Then the file will be deleted when octave
quits or the next purge_tmp_files.
bmpwrite(M,hot,'/tmp/junk.bmp');
mark_for_deletion('/tmp/junk.bmp');
system('open /tmp/junk.bmp;');
This helps to avoid this kind of race condition.
Andy
-------------------------------------------------------------
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
-------------------------------------------------------------