# 1.0 initial release
# 1.1 view size renamed to count, vlerq package renamed to thrill
+# 1.2 replace view calls by vget (simpler and slightly faster)
-package provide vfs::mkcl 1.1
+package provide vfs::mkcl 1.2
package require vfs
package require thrill
# public
proc Mount {mkfile local args} {
set db mkclvfs[incr v::seq]
- set v::rootv($db) [view [vopen $mkfile] get 0 dirs]
- set v::dname($db) [view $v::rootv($db) getcol 0]
- set v::prows($db) [view $v::rootv($db) getcol 1]
+ set v::rootv($db) [vget [vopen $mkfile] 0 dirs]
+ set v::dname($db) [vget $v::rootv($db) * 0]
+ set v::prows($db) [vget $v::rootv($db) * 1]
::vfs::filesystem mount $local [list ::vfs::mkcl::handler $db]
::vfs::RegisterMount $local [list ::vfs::mkcl::Unmount $db]
return $db
}
if {$parent != $r} {
if {$remain == 1} {
- set files [view $dirs get $parent 2]
- set i [lsearch -exact [view $files getcol 0] $e]
+ set files [vget $dirs $parent 2]
+ set i [lsearch -exact [vget $files * 0] $e]
if {$i >= 0} {
- # evaluating this 4-item result returns the info about one file
- return [list view $files get $i]
+ # evaluating this 3-item result returns the info about one file
+ return [list vget $files $i]
}
}
fail ENOENT
}
}
- # evaluating this 5-item result returns the files subview
- return [list view $dirs get $parent 2]
+ # evaluating this 4-item result returns the files subview
+ return [list vget $dirs $parent 2]
}
proc isDir {tag} {
- return [expr {[llength $tag] == 5}]
+ return [expr {[llength $tag] == 4}]
}
# methods
proc matchindirectory {db path actual pattern type} {
if {[isDir $tag]} {
# collect file names
if {$type & 16} {
- set c [eval [linsert $tag end | getcol 0]]
+ set c [eval [linsert $tag end * 0]]
}
# collect directory names
if {$type & 4} {
- foreach r [lsearch -exact -int -all $v::prows($db) [lindex $tag 3]] {
+ foreach r [lsearch -exact -int -all $v::prows($db) [lindex $tag 2]] {
lappend c [lindex $v::dname($db) $r]
}
}
set s 0
set d 0
set c ""
- incr l [eval [linsert $tag end | count]]
- incr l [llength [lsearch -exact -int -all $v::prows($db) [lindex $tag 3]]]
+ incr l [eval [linsert $tag end #]]
+ incr l [llength [lsearch -exact -int -all $v::prows($db) [lindex $tag 2]]]
} else {
set t file
foreach {n s d c} [eval $tag] break
package ifneeded vfs::ftp 1.0 [list source [file join $dir ftpvfs.tcl]]
package ifneeded vfs::http 0.5 [list source [file join $dir httpvfs.tcl]]
package ifneeded vfs::mk4 1.10 [list source [file join $dir mk4vfs.tcl]]
-package ifneeded vfs::mkcl 1.1 [list source [file join $dir mkclvfs.tcl]]
+package ifneeded vfs::mkcl 1.2 [list source [file join $dir mkclvfs.tcl]]
package ifneeded vfs::ns 0.5 [list source [file join $dir tclprocvfs.tcl]]
package ifneeded vfs::tar 0.9 [list source [file join $dir tarvfs.tcl]]
package ifneeded vfs::test 1.0 [list source [file join $dir testvfs.tcl]]
package ifneeded vfs::ftp 1.0 [list source [file join $dir ftpvfs.tcl]]
package ifneeded vfs::http 0.5 [list source [file join $dir httpvfs.tcl]]
package ifneeded vfs::mk4 1.10 [list source [file join $dir mk4vfs.tcl]]
-package ifneeded vfs::mkcl 1.1 [list source [file join $dir mkclvfs.tcl]]
+package ifneeded vfs::mkcl 1.2 [list source [file join $dir mkclvfs.tcl]]
package ifneeded vfs::ns 0.5 [list source [file join $dir tclprocvfs.tcl]]
package ifneeded vfs::tar 0.9 [list source [file join $dir tarvfs.tcl]]
package ifneeded vfs::test 1.0 [list source [file join $dir testvfs.tcl]]