fileutil , a Tcllib module, provides utilties for working with files and directories.
See also the modules in the Documentation section, which don't yet have a wiki page
Other procs that would be useful to add would include wc, tee, head, tail, and perhaps some AWK'ish type functions ala Tclx.
LV: Anyone have a Tcl version of the dircmp command [L1 ]? I don't see it in the cygwin package list, and when I did a casual search on google.
VI 2003-11-28: Nice of you to ask. There's a list above, other than that: tail -f, split, join. I use tkcon as my main shell on a wimpy laptop. Fewer dlls loaded is good..
LV: I think some procs emulating functionality (not necessary flags, etc.) of Unix commands such as:
would be useful. Several of these commands have, at their core, the idea of files being a series of columns, separated by some character or position, and allow a person to select one or more specific columns upon which to perform functions. They represent, in a sense, shortcuts for various AWK scripts.
SS: 2003-12-16: Trying to improve over the Tcl implementation of wc in the Great Language Shootout I wrote this, that seems half in execution time against big files:
set text [read stdin] set c [string length $text] set l [expr {[llength [split $text "\n\r"]]-1}] set T [split $text "\n\r\t "] set w [expr {[llength $T]-[llength [lsearch -all -exact $T {}]]-1}] puts "\t$l\t$w\t$c"
Output seems to be identical to GNU's wc command.
Laif: It should be noted by those who are not familiar with unix - that even in windows xp, if fileutil::find encounters a folder or file named with a single tilde (~), it will append the contents of the person's home directory to the search results. Furthermore, there is a risk of infinite recursion, if somewhere within your home folder, there is also a folder named with a single tilde.