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

Roger Bivand Roger.Bivand at nhh.no
Tue Sep 24 09:53:30 EDT 2002


On Tue, 24 Sep 2002, Markus Neteler wrote:

> (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?).
> 
No daemon around yet ...

What about a cron job - FAQ entry to suggest to people to have cron clear 
up their temp files. Do we know which ones need to be protected from 
removal - this is also info a daemon might need?

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
and: Department of Geography and Regional Development, University of
Gdansk, al. Mar. J. Pilsudskiego 46, PL-81 378 Gdynia, Poland.




More information about the grass-dev mailing list