[GRASS-dev] clean_temp.c versus deleting mapset's .tmp

Vaclav Petras wenzeslaus at gmail.com
Wed May 20 20:26:50 PDT 2015


Hi,

when I was working on grass.py I saw there usage of clean_temp function
which calls clean_temp program and deletion of the whole .tmp directory and
I can't make sense out of it.

It seems to me that clean_temp (lib/init/clean_temp.c) executable called in
grass.py is not necessary because the whole .tmp directory is anyway
deleted at the beginning and at the end of the session. clean_temp is doing
some special cleaning according to pids but whole directory is deleted
anyway at the end. Can the whole lib/init/clean_temp.c can be safely
removed? Or maybe it has some meaning when executed before the session
starts because at that point .tmp is not deleted. Can someone please
clarify this for me here or in the source code?

Also, the clean_temp function is called manually while other cleanups are
called using at exit mechanism. Supposing we need the clean up at all, I'm
not sure if there is any reason to keep it explicit. Perhaps this was just
inconsistency, not an intention.

Thanks for your opinions,
Vaclav

Related code:
http://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py#L1486
http://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py#L1741
http://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py#L1801
http://trac.osgeo.org/grass/browser/grass/trunk/lib/init/grass.py#L1702
https://trac.osgeo.org/grass/browser/grass/trunk/lib/init/clean_temp.c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20150520/2b7ff3eb/attachment.html>


More information about the grass-dev mailing list