[GRASS5] Re: [Pkg-grass-general] r.terraflow ?

Hamish hamish_nospam at yahoo.com
Sat Jun 25 01:04:26 EDT 2005


> > > > What's keeping us from patching r.terraflow then? I'm guessing
> > > > it's probably swapping one libc function for another, no?
..
> > > Not very much, just needs to be changed to use a directory created
> > > with G_tempfile() or tmpfile() instead of /var/tmp/ by default for
> > > the STREAM_DIR= option.
..
> > The simplest approach is likely to be to use the session directory
> > /tmp/grass6-<user>-<pid>. That should be writable only by its owner.
> > 
> > So long as that directory is created securely, we don't need to
> > worry about creating files inside it. At least, not from a security
> > standpoint; race conditions could still be an issue for background
> > processes.
> 
> I'm working on it.  I need some sleep, so I'll finish it up tomorrow
> and post a patch.
> 
> Oddly, enough, I was just about to post a message about handling /tmp.
> Creating a dir as you stated above answered it.
>
> While I'm at it, should I create 'char *G_mktemp(int global)' and 'int
> G_rmtemp(char *path)' functions?


You don't need to create that dir, GRASS does that automatically on
startup and removes it on exit. You just have to point to it.

in the shell:
GRASS_TMPDIR="`dirname $GISRC`/"


Slight problem where it doesn't get cleaned up if you start from the GUI
and hit "Exit" from the startup screen or make a new location by EPSG
number. Perhaps it shouldn't make the dir until after you select a
mapset?

(setup & teardown of tmp dir are in lib/init/init.sh)



Hamish




More information about the grass-dev mailing list