All pastes #159832 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-09-03 15:47 UTC
rendered paste body
proc findDirs { path pattern matchDirs} {
    
    set curDirs ""
    catch {set curDirs [glob -type d -directory $path *]}
    
    if { [llength $curDirs] == 0 } {
	return $matchDirs
    } else {
	foreach dir $curDirs {

	    if { [regexp $pattern $dir] } {
		lappend matchDirs $dir
	    }

	    lappend matchDirs [findDirs $dir $pattern $matchDirs]
	    return $matchDirs
	}
    }
}

set toto [findDirs /monpath/Pack1 .*ru.* ""]
puts $toto