From: Vince Darley Date: Mon, 17 Feb 2003 12:02:37 +0000 (+0000) Subject: filesystem configuration first cut X-Git-Tag: vfs-1-3~53 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=3e8fa6ba6b1c69d17d49e70162afa1c5ff798bc0;p=tclvfs filesystem configuration first cut --- diff --git a/library/vfsUtils.tcl b/library/vfsUtils.tcl index 330f687..8807283 100644 --- a/library/vfsUtils.tcl +++ b/library/vfsUtils.tcl @@ -94,12 +94,14 @@ proc ::vfs::attributes {mountpoint args} { return -code error "filesystem not known or not configurable" } - while {1} { - foreach {attr val} $args { - set args [lrange $args 2 end] - break - } + while {[llength $args] > 1} { + set attr [string range [lindex $args 0] 1 end] + set val [lindex $args 1] + set args [lrange $args 2 end] if {[info commands ::vfs::${ns}::$attr] != ""} { + if {![llength [info args ::vfs::${ns}::$attr]]} { + return -code error "filesystem attribute \"$attr\" is read-only" + } if {[catch {::vfs::${ns}::$attr $val} err]} { return -code error "error setting filesystem attribute\ \"$attr\": $err"