[GRASS-dev] how to check for system in TclTk

Michael Barton michael.barton at asu.edu
Sun May 6 16:31:56 EDT 2007


Paul Kelly sent me this great-sounding tip as a way to get system
information without invoking the Unix command uname, which is unavailable
under windows.

The only problem is that I get an error...

can't read "tcl_platform(platform)": no such variable

...whenever I try to invoke it in a TclTk script. Even odder, if I invoke it
from a wish command line, it is fine (though it report unix on my Mac
because I'm using x11).

Is there some secret trick to using this? It is not apparent in the TclTk
docs that I'm reading.

Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

------ Forwarded Message
> From: Paul Kelly <paul-grass at stjohnspoint.co.uk>
> Date: Sun, 6 May 2007 05:05:46 +0100 (BST)
> To: Michael Barton <michael.barton at asu.edu>
> Cc: <grass-dev at grass.itc.it>
> Subject: Re: [GRASS-dev] Problem with font selection in gis.m on Windows
> Usually I did platform checking in Tcl by looking for environment
> variables that were platform-specific, e.g. something like:
> if {[info exists env(OS)] && $env(OS) == "Windows_NT"}
> but I see in the new d.rast.edit Glynn has used some kind of Tcl variable
> which looks like an even neater way of doing it:
> if {$tcl_platform(platform) == "windows"}

------ End of Forwarded Message

More information about the grass-dev mailing list