• 文件: tcl.tcl
  • Full Path: /www/wwwroot/sh.dnmp.sh/PreviewFiles-20260829032016/05-文本与代码/tcl.tcl
  • Date Modified: 2026.08.24 20:45
  • File size: 523 bytes
  • MIME-type: text/plain
  • Charset: utf-8
proc find {{basedir .} {filterScript {}}} {
    set oldwd [pwd]
    cd $basedir
    set cwd [pwd]
    set filenames [glob -nocomplain * .*]
    set files {}
    set filt [string length $filterScript]
    foreach filename $filenames {
        if {!$filt || [eval $filterScript [list $filename]]} {
            lappend files [file join $cwd $filename]
        }
        if {[file isdirectory $filename]} {
            set files [concat $files [find $filename $filterScript]]
        }
    }
    cd $oldwd
    return $files
}