[GRASS5] Re: [GRASSLIST:4564] Re: .tmp files

Glynn Clements glynn.clements at virgin.net
Wed Sep 25 08:32:38 EDT 2002


Markus Neteler wrote:

> > The issue is changing the various modules to use it.
> 
> E.g. one problem is v.to.rast. It doesn't use G_tempfile() at all but
> a private solution instead

What? Where? I couldn't find anything (other than popen(), which
doesn't create any files).

> (and does not delete anything when this process is killed - signal
> handler required here?).

Signal handlers are an option if the file can't be unlink()ed. But
that still doesn't handle every case. It won't handle power failure,
hardware reset, instant reboot due to a kernel panic, or SIGKILL. 

Also, it's risky trying to do too much when handling exceptions such
as SIGSEGV, SIGBUS etc, as they tend to indicate a program
malfunction, which may have corrupted memory.

Another issue: it may be better to create temporary files in a
standard directory (/tmp, /var/tmp, or $TMPDIR), as many systems will
clean those automatically (e.g. upon reboot).

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-dev mailing list