[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What does imagesc.m need?
From: |
Joe Koski |
Subject: |
Re: What does imagesc.m need? |
Date: |
Wed, 03 Mar 2004 12:53:13 -0700 |
User-agent: |
Microsoft-Entourage/10.1.4.030702.0 |
on 3/3/04 5:14 AM, Andy Adler at address@hidden wrote:
>> 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.
>
Thanks Andy. I tried this, and it seems to be working well.
Joe Koski
-------------------------------------------------------------
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
-------------------------------------------------------------