[GRASS-dev] select issue with wingrass

Michael Barton michael.barton at asu.edu
Tue Nov 6 10:18:58 EST 2007


Glynn,

I agree that it certainly looks like the problem code is

glob -nocomplain $path/*

"glob" ought to work because it is pure TclTk in this case (although
identical to the unix command). What about the "*"?

I don't know how to test this on Windows. Suggestions?

Michael


On 11/6/07 2:55 AM, "Glynn Clements" <glynn at gclements.plus.com> wrote:

> The relevant code is:
> 
>     # main selection subroutine
>     if {$element != "symbol"} {
>         foreach dir [exec g.mapsets -p] {
>             set windfile "$location_path/$dir/WIND"
>             if { ! [ file exists $windfile ] } { continue }
>             if { $dir == $current_mapset } {
>                 $tree insert end root ms_$dir -text $dir -data $dir -open 1 \
>                 -image [Bitmap::get openfold] -drawcross auto
>             } else {
>                 $tree insert end root ms_$dir -text $dir -data $dir -open 0 \
>                 -image [Bitmap::get folder] -drawcross auto
>             }
>             set path "$location_path/$dir/$element/"
>             foreach fp [ lsort [glob -nocomplain $path/*] ]  {
>             set file [file tail $fp]
>             $tree insert end ms_$dir $file@$dir -text $file -data $file \
>                 -image [Bitmap::get file] -drawcross never
>             }
>         }
>     }
> 
> The "file exists $windfile" test is obviously working, otherwise he
> wouldn't see the mapsets. The most likely problem is with the "glob"
> command. The glob(n) manpage implies that / should work. Can you try
> running tclsh/wish interactively and testing the behaviour of the glob
> command?
> 

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
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





More information about the grass-dev mailing list