TCL / Linux question

Thread Starter

drjohsmith

Joined Dec 13, 2021
852
Any tcl experts around ,
want to make a TCL list of the path / file name of all files below me that have .fre extension

such as my_test.fre

I think I can do it in linux,
e.g. tree -P "*.fre"

but want the path/filename into a list
so I can do things on each of the files I find in TCL.

No, its not home work, its for work !!!!
 

Thread Starter

drjohsmith

Joined Dec 13, 2021
852
that looks interesting , well found,
I'll give it a go tomorrow,

set files [glob -nocomplain -type f *]
if { [llength $files] > 0 } {
puts "Files:"
foreach f [lsort $files] {
puts " [file size $f] - $f"
}
} else {
puts "(no files)"
}
two forward, one back
the glob only seemed to list files in the current folder
uhm,
so need to make a recursive script, find directories, and move down , putting file and path name into list !
uhm,
 
Top