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

Markus Neteler neteler at itc.it
Tue Sep 24 08:10:42 EDT 2002


(moving this to the developers list)

On Tue, Sep 24, 2002 at 03:01:45AM +0100, Glynn Clements wrote:
> 
> Gordon Keith wrote:
> 
> > > The ".tmp" directory should get cleaned whenever you exit a GRASS
> > > session.
> > >
> > > If your ".tmp" directories are accumulating files, that suggests that
> > > GRASS sessions are being terminated abnormally, e.g. by killing the
> > > xterm. Always terminate the session by typing "exit" in the shell.
> > 
> > OK.
> > 
> > It's probably my fault then.
> > 
> > I've been using g.gisenv set= to swap better mapsets and locations a lot 
> > rather than having to exit and restart grass several times a day. I 
> > guess this is one of the gotchas of doing that.
> 
> OK; yes, the other reason why temporary files may accumulate is if you
> have long-running sessions. Until recently this seldom happened, as
> you had to quit in order to change the location or mapset.

Well, this happens regularly (at least for our group).
We work in one location only, so there is no obvious reason
to leave the location. Then the .tmp/ stuff accumulates quickly.

One problem is that some GRASS modules open temp files with
G_tempfile() but do not remove them on exit.
We were talking about that also in May:

http://grass.itc.it/pipermail/grass5/2002-May/002978.html

> Either terminate the session at the end of the day, or manually run
> $GISBASE/etc/clean_temp occasionally. Unfortunately, this can't be
> automated, as a few programs expect temporary files to survive for a
> while after the program which created them has terminated.
>
> Mostly this is due to either:
> 
> a) a program creating a temporary file, then running some other
> program with that temporary file as input.
> 
> b) d.text, which saves its input in a temporary file; this file needs
> to remain until the monitor is erased, as it will be used if the
> monitor needs to be redrawn (either via d.resize/d.redraw or, for
> XDRIVER, if the monitor is resized via the window manager).
> 
> Apart from that, I suspect that a lot of programs need to take more
> care to remove temporary files once they are no longer needed.

Yes.

Another suggestion may be a GRASS daemon which get's informed about
temp files and can delete them later (rather than the  simplistic 
clean_temp approach). We should probably centralize such management
functionality.

Roger, does your GRASS daemon have such capabilities (or potential to
be extended?).

Markus




More information about the grass-dev mailing list