[GRASS-dev] g.mapset problems
Glynn Clements
glynn at gclements.plus.com
Wed May 31 12:43:21 EDT 2006
Michael Barton wrote:
> I¹m trying to use g.mapset in a TclTk script and am having problems. I hope
> that someone can help with this.
>
> First, when I run it, it sends out text output stderror that seems to lock
> it up if I try to redirect to /dev/null
No idea as to the cause, but if you add "2>&1" to the command, stderr
will be redirected to stdout. That will prevent Tcl from treating it
as an error.
> Second, if I try to run it to switch to a new location/mapset, and it
> doesn¹t work, the next time I try to switch the same location/mapset, I get
> the error...
>
> ³cmbarton is currently running GRASS in selected mapset or lock file cannot
> be checked.²
>
> ...even if I am not working in that mapset. Does anyone know what is going
> on?
It's possible that $GISBASE/etc/lock creates the .gislock file but
returns a non-zero exit status, resulting in g.mapset not updating
$GISRC. If that happens, the new mapset will be locked but won't be
made the current mapset. Further attempts to switch to it will fail
due to the lock.
Also, I note that the lock handing in etc/Init.sh assumes that the
current mapset doesn't change throughout a session. I.e. when you exit
GRASS, it deletes the .gislock file which was created at startup, not
the one for the current mapset at termination time.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list