::mk4vfs::_umount $db
}
+ proc attributes {db} { return [list "state" "commit"] }
+
+ # Can use this to control commit/nocommit or whatever.
+ # I'm not sure yet of what functionality jcw needs.
+ proc commit {db args} {
+ switch -- [llength $args] {
+ 0 {
+ if {$::mk4vfs::v::mode($db) == "readonly"} {
+ return 0
+ } else {
+ # To Do: read the commit state
+ return 1
+ }
+ }
+ 1 {
+ set val [lindex $args 0]
+ if {$val != 0 && $val != 1} {
+ return -code error \
+ "invalid commit value $val, must be 0,1"
+ }
+ # To Do: set the commit state.
+ }
+ default {
+ return -code error "Wrong num args"
+ }
+ }
+ }
+
proc state {db args} {
switch -- [llength $args] {
0 {
set auto_index(::vfs::ftp::Mount) [list source [file join $dir ftpvfs.tcl]]
set auto_index(::vfs::ftp::Unmount) [list source [file join $dir ftpvfs.tcl]]
set auto_index(::vfs::ftp::handler) [list source [file join $dir ftpvfs.tcl]]
+set auto_index(::vfs::ftp::attributes) [list source [file join $dir ftpvfs.tcl]]
+set auto_index(::vfs::ftp::state) [list source [file join $dir ftpvfs.tcl]]
set auto_index(::vfs::ftp::stat) [list source [file join $dir ftpvfs.tcl]]
set auto_index(::vfs::ftp::access) [list source [file join $dir ftpvfs.tcl]]
set auto_index(::vfs::ftp::open) [list source [file join $dir ftpvfs.tcl]]
set auto_index(::vfs::http::utime) [list source [file join $dir httpvfs.tcl]]
set auto_index(::vfs::mk4::Mount) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::vfs::mk4::Unmount) [list source [file join $dir mk4vfs.tcl]]
+set auto_index(::vfs::mk4::attributes) [list source [file join $dir mk4vfs.tcl]]
+set auto_index(::vfs::mk4::commit) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::vfs::mk4::state) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::vfs::mk4::handler) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::vfs::mk4::utime) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::vfs::mk4::deletefile) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::vfs::mk4::fileattributes) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::init) [list source [file join $dir mk4vfs.tcl]]
-set auto_index(::mk4vfs::mount) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::_mount) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::periodicCommit) [list source [file join $dir mk4vfs.tcl]]
-set auto_index(::mk4vfs::umount) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::_umount) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::stat) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::do_close) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::getdir) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::mtime) [list source [file join $dir mk4vfs.tcl]]
set auto_index(::mk4vfs::delete) [list source [file join $dir mk4vfs.tcl]]
+set auto_index(::mk4vfs::mount) [list source [file join $dir mk4vfs.tcl]]
+set auto_index(::mk4vfs::umount) [list source [file join $dir mk4vfs.tcl]]
set auto_index(loadvfs) [list source [file join $dir pkgIndex.tcl]]
set auto_index(::starkit::header) [list source [file join $dir starkit.tcl]]
set auto_index(::starkit::startup) [list source [file join $dir starkit.tcl]]
set auto_index(::vfs::tar::Mount) [list source [file join $dir tarvfs.tcl]]
set auto_index(::vfs::tar::Unmount) [list source [file join $dir tarvfs.tcl]]
set auto_index(::vfs::tar::handler) [list source [file join $dir tarvfs.tcl]]
+set auto_index(::vfs::tar::attributes) [list source [file join $dir tarvfs.tcl]]
+set auto_index(::vfs::tar::state) [list source [file join $dir tarvfs.tcl]]
set auto_index(::vfs::tar::matchindirectory) [list source [file join $dir tarvfs.tcl]]
set auto_index(::vfs::tar::stat) [list source [file join $dir tarvfs.tcl]]
set auto_index(::vfs::tar::access) [list source [file join $dir tarvfs.tcl]]
set auto_index(::vfs::unmount) [list source [file join $dir vfsUtils.tcl]]
set auto_index(::vfs::states) [list source [file join $dir vfsUtils.tcl]]
set auto_index(::vfs::attributes) [list source [file join $dir vfsUtils.tcl]]
+set auto_index(::vfs::attributeCantConfigure) [list source [file join $dir vfsUtils.tcl]]
set auto_index(::vfs::haveMount) [list source [file join $dir vfsUtils.tcl]]
set auto_index(::vfs::urlMount) [list source [file join $dir vfsUtils.tcl]]
set auto_index(::vfs::fileUrlMount) [list source [file join $dir vfsUtils.tcl]]
set auto_index(::vfs::zip::Mount) [list source [file join $dir zipvfs.tcl]]
set auto_index(::vfs::zip::Unmount) [list source [file join $dir zipvfs.tcl]]
set auto_index(::vfs::zip::handler) [list source [file join $dir zipvfs.tcl]]
+set auto_index(::vfs::zip::attributes) [list source [file join $dir zipvfs.tcl]]
+set auto_index(::vfs::zip::state) [list source [file join $dir zipvfs.tcl]]
set auto_index(::vfs::zip::matchindirectory) [list source [file join $dir zipvfs.tcl]]
set auto_index(::vfs::zip::stat) [list source [file join $dir zipvfs.tcl]]
set auto_index(::vfs::zip::access) [list source [file join $dir zipvfs.tcl]]
proc ::vfs::attributes {mountpoint args} {
set handler [::vfs::filesystem info $mountpoint]
- set attrs [list "state"]
set res {}
+
+ if {[regsub -- "::handler" $handler ::attributes cmd]} {
+ set attrs [eval $cmd]
+ } else {
+ return -code error "No known attributes"
+ }
if {![llength $args]} {
foreach attr $attrs {
return $res
}
+proc vfs::attributeCantConfigure {attr val largs} {
+ switch -- [llength $largs] {
+ 0 {
+ return $val
+ }
+ 1 {
+ return -code error "Can't set $attr"
+ }
+ default {
+ return -code error "Wrong num args"
+ }
+ }
+}
+
::vfs::autoMountExtension "" ::vfs::mk4::Mount vfs
::vfs::autoMountExtension .bin ::vfs::mk4::Mount vfs
::vfs::autoMountExtension .kit ::vfs::mk4::Mount vfs