Welcome, guest! Login / Register - Why register?

Paste

Short URL: N/A
Pasted as Tcl by Luka on Friday, February 19th, 2010 11:55am ( 7 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
   }
 }
}

 

Revise this Paste

Children: 41285
Your Name:
Code Language: