-2010-05-16 Steve Huntley <stephen.huntley@alum.mit.edu>
-
- * library/vfslib.tcl: Changed memchan condition from Tcl version 8.6 or
- greater to presence of chan command (since chan now in later 8.5 builds)
-
-2010-02-01 Steve Huntley <stephen.huntley@alum.mit.edu>
-
- * Makefile.in (PKG_TCL_SOURCES): Added 'template/tclIndex' to the list
- of installed files. Required for vfs's based on template vfs to load.
-
-2010-01-30 Steve Huntley <stephen.huntley@alum.mit.edu>
-
- * templatevfs.tcl: workaround for bug in how virtual volumes
- are mounted. Version bumped to 1.5.4. See:
-http://sf.net/tracker/?func=detail&aid=2886914&group_id=10894&atid=110894
-
-2009-10-20 Steve Huntley <stephen.huntley@alum.mit.edu>
-
- * tclIndex: Corrected version number.
- * pkgIndex.tcl.in: Edited to replace function of deleted
- pkgIndex.tcl in template subdir.
-
-2009-10-15 Steve Huntley <stephen.huntley@alum.mit.edu>
-
- vfs::template package update ver. 1.5.3:
-
- * templatevfs.tcl: Incorporated AK's fix below.
- * collatevfs.tcl: ensured binary file contents got written
- correctly, and ensured that not only file contents but
- also file attributes were updated to all write targets.
-
2009-07-06 Andreas Kupries <andreask@activestate.com>
* library/template/templatevfs.tcl (memchan): Fix result for
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: Makefile.in,v 1.31 2010/02/01 07:32:58 blacksqr Exp $
+# RCS: @(#) $Id: Makefile.in,v 1.30 2009/02/06 19:13:27 andreas_kupries Exp $
#========================================================================
# Edit the following few lines when writing a new extension
template/fishvfs.tcl template/globfind.tcl \
template/quotavfs.tcl template/tdelta.tcl \
template/templatevfs.tcl template/versionvfs.tcl \
- template/chrootvfs.tcl template/tclIndex vfs.tcl
+ template/chrootvfs.tcl vfs.tcl
#========================================================================
Written by Stephen Huntley (stephen.huntley@alum.mit.edu)
License: Tcl license
-Version 1.5.3
+Version 1.5
A collate/broadcast/collect/catchup virtual filesystem. Requires the template vfs in templatevfs.tcl.
}
package require vfs::template 1.5
+package provide vfs::template::collate 1.5.2
namespace eval ::vfs::template::collate {
proc close_ {channel} {
upvar root root relative relative
foreach file [lrange [WriteFile $root $relative close] 1 end] {
- if ![WriteTest $file] {continue}
- file mkdir [file dirname $file]
set f [open $file w]
- fconfigure $f -translation binary
seek $channel 0
fcopy $channel $f
close $f
}
proc file_atime {file time} {
upvar root root relative relative
- foreach file [WriteFile $root $relative open] {
- file atime $file $time
- }
+ set file [AcquireFile $root $relative]
+ file atime $file $time
}
proc file_mtime {file time} {
upvar root root relative relative
- foreach file [WriteFile $root $relative open] {
- file mtime $file $time
- }
+ set file [AcquireFile $root $relative]
+ file mtime $file $time
}
proc file_attributes {file {attribute {}} args} {
upvar root root relative relative
+ set file [AcquireFile $root $relative]
if {($relative == {}) && ([string map {-read 1 -write 1 -collect 1 -catchup 1} $attribute] == 1)} {
set attribute [string range $attribute 1 end]
if {$args == {}} {eval return \$::vfs::template::collate::${attribute}(\$root)}
set ::vfs::template::collate::catchup [file isdirectory [lindex $::vfs::template::collate::catchupstore 0]]
return
}
- if {$args != {}} {
- foreach file [WriteFile $root $relative open] {
- file attributes $file $attribute $args
- }
- return
- }
- set file [AcquireFile $root $relative]
set returnValue [eval file attributes \$file $attribute $args]
if {($relative == {}) && ($attribute == {})} {set returnValue [concat $returnValue [list -read $::vfs::template::collate::read($root) -write $::vfs::template::collate::write($root) -collect $::vfs::template::collate::collect($root) -catchup $::vfs::template::collate::catchupstore($root)]]}
return $returnValue
return $returnValue
}
-proc WriteTest {args} {
- return 1
-}
-
}
# end namespace ::vfs::template::collate
# element name is the name of a command and the value is
# a script that loads the command.
-set auto_index(::vfs::template::mount) [list package require vfs::template 1.5.3]
+set auto_index(::vfs::template::mount) [list package require vfs::template 1.5.2]
set auto_index(::vfs::template::collate::mount) [list source [file join $dir collatevfs.tcl]]
set auto_index(::vfs::template::quota::mount) [list source [file join $dir quotavfs.tcl]]
set auto_index(::vfs::template::version::mount) [list source [file join $dir versionvfs.tcl]]
Written by Stephen Huntley (stephen.huntley@alum.mit.edu)
License: Tcl license
-Version 1.5.4
+Version 1.5.3
The template virtual filesystem is designed as a prototype on which to build new virtual
filesystems. Only a few simple, abstract procedures have to be overridden to produce a new
vfs::posixError load
unset vfs::posix(load)
-package provide vfs::template 1.5.4
+package provide vfs::template 1.5.3
namespace eval ::vfs::template {
set [namespace current]::cache($to) $cache
# register location with Tclvfs package:
- set div {}
- if {$volume ne {}} {
- if {[string index $to end] ne "/"} {
- set div /
- }
- }
- eval ::vfs::filesystem mount $volume \$to$div \[list [namespace current]::handler \$path\]
+ eval ::vfs::filesystem mount $volume \$to \[list [namespace current]::handler \$path\]
::vfs::RegisterMount $to [list [namespace current]::unmount]
# ensure close callback background error appears at script execution level:
# undo Tclvfs API hooks:
proc unmount {to} {
- if {[lsearch [::vfs::filesystem info] $to] < 0} {
- set to [::file normalize $to]
- }
+ set to [::file normalize $to]
set path [lindex [::vfs::filesystem info $to] end]
# call custom unmount procedure:
set chan [uplevel 1 ::memchan $args]
return $chan
} else {
- return [eval [linsert $args 0 ::vfs::memchan]]
+ return [eval [linsert $args 0 ::vfs::memchan]]
}
}
catch {rename ::exit ::vfs::template::exit}
-proc ::exit {args} {
+proc ::exit {} {
foreach vfs [::vfs::filesystem info] {
- if [catch {$::vfs::_unmountCmd([file normalize $vfs]) $vfs} result] {
+ if [catch {$::vfs::_unmountCmd($vfs) $vfs} result] {
puts "$vfs: $result"
}
}
- ::vfs::template::exit [lindex $args 0]
+ ::vfs::template::exit
}
# Use 8.6 reflected channels or the rechan package in earlier versions to
# provide a memory channel implementation.
#
-if {[info command ::chan] ne {}} {
+if {[package vsatisfies [package provide Tcl] 8.6]} {
# As the core zlib channel stacking make non-seekable channels we cannot
# implement vfs::zstream and this feature is disabled in tclkit boot.tcl
#
# Virtual filesystems based on the template vfs:
#
-if {[lsearch -exact $::auto_path [file join $dir template]] == -1} {
- lappend ::auto_path [file join $dir template]
-}
-package ifneeded vfs::template 1.5.4 \
+package ifneeded vfs::template::chroot 1.5.2 \
+ [list source [file join $dir template chrootvfs.tcl]]
+package ifneeded vfs::template::collate 1.5.2 \
+ [list source [file join $dir template collatevfs.tcl]]
+package ifneeded vfs::template::version 1.5.2 \
+ [list source [file join $dir template versionvfs.tcl]]
+package ifneeded vfs::template::version::delta 1.5.2 \
+ [list source [file join $dir template deltavfs.tcl]]
+package ifneeded vfs::template::fish 1.5.2 \
+ [list source [file join $dir template fishvfs.tcl]]
+package ifneeded vfs::template::quota 1.5.2 \
+ [list source [file join $dir template quotavfs.tcl]]
+package ifneeded vfs::template 1.5.3 \
[list source [file join $dir template templatevfs.tcl]]
#
# Helpers