set altname "" ;#possible we have to use a different name e.g short windows name or dos-device path //?/
set altname "" ;#possible we have to use a different name e.g short windows name or dos-device path //?/
# return it so it can be stored and tried as an alternative for problem paths
# return it so it can be stored and tried as an alternative for problem paths
#puts stderr ">>> glob: $opt_glob"
#REVIEW! windows api pattern matchttps://www.red-gate.com/simple-talk/blogs/the-unexpected-behaviour-of-directoryinfo-getfiles-with-three-letter-extensions/hing is .. weird. partly due to 8.3 filenames
#we will certainly need to check the resulting listing with our supplied glob.. but maybe we will have to change the glob passed to find_file_open too.
# using * all the time may be inefficient - so we might be able to avoid that in some cases.
try {
try {
#glob of * will return dotfiles too on windows
#glob of * will return dotfiles too on windows
set iterator [twapi::find_file_open [file join $folderpath $opt_glob] -detail basic] ;# -detail full only adds data to the altname field
set iterator [twapi::find_file_open [file join $folderpath $opt_glob] -detail basic] ;# -detail full only adds data to the altname field
@ -682,6 +687,11 @@ namespace eval punk::du {
while {[twapi::find_file_next $iterator iteminfo]} {
while {[twapi::find_file_next $iterator iteminfo]} {
set nm [dict get $iteminfo name]
set nm [dict get $iteminfo name]
#recheck glob
#review!
if {![string match $opt_glob $nm]} {
continue
}
set tail_altname [dict get $iteminfo altname] ;#altname of tail - not whole path
set tail_altname [dict get $iteminfo altname] ;#altname of tail - not whole path
set attrinfo [decode_win_attributes [dict get $iteminfo attrs]]
set attrinfo [decode_win_attributes [dict get $iteminfo attrs]]