Edit code: here. | Add this to your website. | Report abuse.
Short URL: N/A
Pasted as TCL by Luka on Friday, February 19th, 2010 11:55am ( 2 years ago )
- proc listTree {rootdir_} {
- set currentnodes [glob -nocomplain -directory $rootdir_ -type d *]
- if {[llength $currentnodes] <= 0} {
- # aktualny katalog jest lisciem i posiada pliki to wypisz te pliki
- set fileslastnode [glob -nocomplain -directory $rootdir_ -type f *]
- if {[llength $fileslastnode] > 0} {
- foreach eachfile $fileslastnode {
- puts "$eachfile"
- }
- }
- return
- } else {
- # Rekursywnie przegladaj wszystkie katalogi
- foreach node $currentnodes {
- listTree $node
- }
- }
- }
Child(s): 41285