Overview
| Artifact ID: | 73daff148d27768b59558c8638fd522dd045154a |
|---|---|
| Ticket: | 1880980fffffffffffffffffffffffffffffffff
Option to [glob] to ease recursive traversal |
| User & Date: | evil_son on 2008-01-28 07:12:34 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
Currently, to traverse a directory hierarchy: in the top directory we need to explicitly glob for all directory entries (including those that start with a period) and then filter out "." and ".." and so on recursively for children directories The following suggested option to [glob] will simplify code as well as provide some speed increase. [glob -walk] will return all directory entries in the current dir including those that start with a period _except_ for "." and ".." i.e it filters out the current and parent directories. Other filters can be stacked on top of it as per usual with [glob] This option does _not_ walk the entire directory tree recursively. As such the name "-walk" may be considered misleading. [glob -walk] essentially provides a filter to a previously suggested option [glob -all]: request id 1880967 at http://sourceforge.net/tracker/index.php?func=detail&aid=1880967&group_id=10894&atid=360894 and may well be used more often than [glob -all] raising doubts about the need for the latter. Checking for recursive links in the filesystem is still the responsibility of the user. e.g usage. To print the names of all and only directories under $root: proc rec-print-dirs {dir} { puts $dir foreach d [glob -walk -directory $dir -types {d}] { rec-print-dirs $d } } rec-print-dirs $root Thank you E Wilson - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "evil_son"
- subsystem changed to: "16. Commands A-H"
- title changed to: "Option to [glob] to ease recursive traversal"
- type changed to: "RFE"