What is the standard way in TCL to get a list of all files in a
directory and its subdirectories?
Regards,
August
package require fileutil
fileutil::find
(Requires Tcllib installed.)
--
Darren New / San Diego, CA, USA (PST)
His kernel fu is strong.
He studied at the Shao Linux Temple.
Works like a charm. Thanks.
August
glob
http://www.tcl.tk/man/tcl8.4/TclCmd/glob.htm
I have to admit, that is one non-intuitive command name. One would think
there would be a "file" command that accomplishes that task.
Well, it's a C standard library function:
The glob() function is a pathname generator that implements the rules
for file name pattern matching used by the shell.
See e.g. http://www.hmug.org/man/3/glob.php
The original poster asked for "all files in a directory and its
subdirectories"; so fileutil::find is absolutely the right thing.
Donal.
I like for_recursive_glob from Tclx (there is also just
recursive_glob).
Ah, that depends on whether the OP's request contains an implicit
"recursively".
If it does, yes, fileutil::find is right. If it doesn't, glob * */*
does the job.
Bill
You are right, after rereading my posting I realise I should have added
the word "recursively".
Thank you all for your helpful answers.
August