diff options
author | Steve Bennett <steveb@workware.net.au> | 2014-08-08 11:52:23 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2014-08-08 11:59:27 +1000 |
commit | 0c24afc040fcdcdc51513ea946a1cf4b36987a09 (patch) | |
tree | ee1e205ece2082ff08c6b6344d5e10a0f4490b47 /glob.tcl | |
parent | 0b60827ba7bbbefd991a99dfcae4973d51387f82 (diff) | |
download | jimtcl-0c24afc040fcdcdc51513ea946a1cf4b36987a09.zip jimtcl-0c24afc040fcdcdc51513ea946a1cf4b36987a09.tar.gz jimtcl-0c24afc040fcdcdc51513ea946a1cf4b36987a09.tar.bz2 |
glob: work when intermidiate dirs are not readable
If /a/b/c exists, but directory 'a' has 'x' but not 'r'
permissions, we should still be able to glob /a/b/*
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'glob.tcl')
-rw-r--r-- | glob.tcl | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -9,6 +9,11 @@ package require readdir # Return a list of all entries in $dir that match the pattern. proc glob.globdir {dir pattern} { + if {[file exists $dir/$pattern]} { + # Simple case + return $pattern + } + set result {} set files [readdir $dir] lappend files . .. |