Profile
Pastes: 45834
Members: 649

Oh, look!

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 )

  1. proc listTree {rootdir_} {
  2.     set currentnodes [glob -nocomplain -directory $rootdir_ -type d *]
  3.     if {[llength $currentnodes] <= 0} {
  4.  # aktualny katalog jest lisciem i posiada pliki to wypisz te pliki
  5.   set fileslastnode [glob -nocomplain -directory $rootdir_ -type f *]
  6.   if {[llength $fileslastnode] > 0} {
  7.    foreach eachfile $fileslastnode {
  8.     puts "$eachfile"
  9.    }
  10.   }
  11.   return
  12.     } else {
  13.      # Rekursywnie przegladaj wszystkie katalogi
  14.    foreach node $currentnodes {
  15.    listTree $node
  16.    }
  17.  }
  18. }

Child(s): 41285
Your Name:
Code Language:
Security Image:
Text seen in Image: