Browse Source

fix file sorting, fix nslist_dict alias

master
Julian Noble 1 year ago
parent
commit
c1d638c984
  1. 6
      src/modules/punk-0.1.tm

6
src/modules/punk-0.1.tm

@ -3596,7 +3596,7 @@ namespace eval punk {
} }
#file normalize may change backslashes to forward slashes.. including things like the special \\?\ prefix which is intended to stop windows api from parsing a name #file normalize may change backslashes to forward slashes.. including things like the special \\?\ prefix which is intended to stop windows api from parsing a name
#2023 - this is ok as //?/ also seems to work.. but it is unclear if that is because Tcl is re-converting to backslashes #2023 - this is ok as //?/ also seems to work.. but it is unclear if that is because Tcl is re-converting to backslashes
if {[punk::winpath_illegalname_test] $path} { if {[punk::winpath_illegalname_test $path]} {
set path [punk::winpath_illegalname_fix $path] set path [punk::winpath_illegalname_fix $path]
} }
@ -4112,6 +4112,7 @@ namespace eval punk {
#also determine whether vfs. file system x is *much* faster than file attributes #also determine whether vfs. file system x is *much* faster than file attributes
set vfs [list] ;#dict keyed on dir/file name set vfs [list] ;#dict keyed on dir/file name
set dirs [glob -nocomplain -directory $location -type d -tail $glob] set dirs [glob -nocomplain -directory $location -type d -tail $glob]
set dirs [lsort $dirs] ;#todo - natsort
foreach d $dirs { foreach d $dirs {
if {[lindex [file system $d] 0] eq "tclvfs"} { if {[lindex [file system $d] 0] eq "tclvfs"} {
lappend vfs $d [file system $d] lappend vfs $d [file system $d]
@ -4119,6 +4120,7 @@ namespace eval punk {
} }
set files [glob -nocomplain -directory $location -type f -tail $glob] set files [glob -nocomplain -directory $location -type f -tail $glob]
set files [lsort $files] ;#todo natsort
return [list dirs $dirs vfs $vfs files $files location $location] return [list dirs $dirs vfs $vfs files $files location $location]
} }
proc dirfiles {{glob ""}} { proc dirfiles {{glob ""}} {
@ -5114,7 +5116,7 @@ namespace eval punk {
#namespace/command/proc query #namespace/command/proc query
interp alias {} nslist {} punk::nslist interp alias {} nslist {} punk::nslist
interp alias {} nslist_dict {} punk::nslist interp alias {} nslist_dict {} punk::nslist_dict
if {$::tcl_platform(platform) eq "windows"} { if {$::tcl_platform(platform) eq "windows"} {
set has_powershell 1 set has_powershell 1

Loading…
Cancel
Save