set srcpath [resolve pwd $pwd$release]
set nesting 3
set knownfiles 0
set knowndirs 0
set subdir "*"
set sizeneeded 0
for {set level 0} {$level < $nesting} {incr level} {
set test [glob -nocomplain -directory $srcpath "$subdir"]
foreach dir $test {
if {[file isdirectory "$dir"]} {
lappend dirs "$dir "
incr knowndirs
} else {
if {![string match -nocase "*/.*" $dir]} {
incr knownfiles
}
}
set sizeneeded [expr [expr $sizeneeded + [file size $dir]] * 1.0]
}
append subdir "/*"
}
set sizeneeded [expr [expr $sizeneeded / 1024] * 1.0]
this is basically what i use in ioPRE to check for enough free space
in a destination path before `pre`, i guess you can work out the rest
__________________
#iotools #ioftpd (both on efnet)
|