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

Markus Neteler neteler at itc.it
Wed Sep 25 06:41:28 EDT 2002


On Wed, Sep 25, 2002 at 04:26:26AM +0100, Glynn Clements wrote:
[...]
> > > 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.
> 
> First, I think that widespread implementation of Eric's suggestion
> (unlinking the file immediately upon creation) will mostly solve the
> problem.

Yes, it looks nice. Eric, do you want to submit that?

> While temporary files would still accumulate, this would be limited to
> the relatively few programs which actually need the temporary file to
> be accessible by other programs. AFAICT, most programs which create
> temporary files would work with an "anonymous" file, although a few
> might need minor changes (i.e. fseek()ing to the beginning of the file
> rather than close()ing and re-open()ing it).
> 
> Also, it may be worthwhile running clean_temp on startup. This would
> catch the case where a previous session (using the same mapset)
> terminated abnormally.

I have added that to:
src/general/init/init.sh

> Regarding a cron job: it would probably be safe to delete temporary
> files which were more than a day old. It seems unlikely that files
> which are that old would still be in use.
Mhh. But what if the user doesn't leave GRASS for a week or
just continues two days later due to Sunday?

> As for d.text; the issue indicates a fundamental problem with the
> concepts which underlie d.save etc. These issues will need to be
> addressed fully if the ability to switch location/mapset is to be
> fully realised.

Markus




More information about the grass-dev mailing list