+2003-01-28 Vince Darley <vincentdarley@sourceforge.net>
+ * library/*.tcl: add 'package provide vfs::<name>' to the
+ virtual filesystems. These are the current versions:
+
+ package ifneeded vfs::ftp 1.0
+ package ifneeded vfs::http 0.5
+ package ifneeded vfs::mk4 1.6
+ package ifneeded vfs::ns 0.5
+ package ifneeded vfs::tar 0.9
+ package ifneeded vfs::test 1.0
+ package ifneeded vfs::urltype 1.0
+ package ifneeded vfs::webdav 0.1
+ package ifneeded vfs::zip 1.0
+
+ I've used '0.1' to indicate a very preliminary version, 0.5 for
+ something which has had some work, 0.9 for nearly complete and
+ 1.0 or newer for something which is well used.
+
+ There is no need to do 'package require vfs', simply do a package
+ require of the particular vfs implementation you want from the
+ above list.
+
+ * DESCRIPTION.txt:
+ * make55.tcl: new files for TIP55 compliance. (Steve Cassidy)
+
2003-01-16 Vince Darley <vincentdarley@sourceforge.net>
* library/tarvfs.tcl:
* library/zipvfs.tcl: ::close .zip or .tar file when unmounting
--- /dev/null
+Identifier: vfs
+Version: 1.0
+Title: Interface to Virtual File Systems for Tcl 8.4
+Creator: Vince Darley
+Description: The goal of this extension is to expose Tcl 8.4's new
+ filesystem C API to the Tcl level.
+Rights: BSD
+URL: http://sourceforge.net/projects/tclvfs
+Date: 2002-05-25
+Architecture: tcl
+Architecture: Linux-x86
+Require: tcl 8.4
+Recommend: Trf
+Recommend: http 2.6
+Recommend: base64
+Recommend: Memchan
+Recommend: Mk4tcl
+Recommend: ftp
+Subject: filesystem
package require vfs
+package require vfs::zip
+package require vfs::urltype
+package require vfs::ftp
+package require vfs::http
+
puts "Adding ftp:// volume..."
vfs::urltype::Mount ftp
set listing [glob -dir ftp://ftp.scriptics.com/pub *]
cd localmount ; cd tcl
puts "(pwd is now '[pwd]' which is effectively a transparent link\
to a remote ftp site)"
+puts "Contents of remote directory is:"
+foreach file [glob -nocomplain *] {
+ puts "\t$file"
+}
puts "sourcing remote file 'vfsTest.tcl', using 'source vfsTest.tcl'"
# This will actually source the contents of a file on the
# remote ftp site (which is now the 'pwd').
+package provide vfs::ftp 1.0
+
package require vfs 1.0
package require ftp
+package provide vfs::http 0.5
+
package require vfs 1.0
package require http
} else {
# single file
- if {![catch {access $dirurl $path}]} {
+ if {![catch {access $dirurl $path 0}]} {
lappend res $path
}
}
# 16oct02 jcw 1.6 fixed periodic commit once a change is made
package provide mk4vfs 1.6
+package provide vfs::mk4 1.6
package require Mk4tcl
package require vfs
}
proc handler {db cmd root relative actualpath args} {
- #puts stderr "handler: $db - $cmd - $root - $relative - $actualpath - $args"
+ #puts stderr "handler: $db - $cmd - $root - $relative\
+ #- $actualpath - $args"
if {$cmd == "matchindirectory"} {
eval [list $cmd $db $relative $actualpath] $args
} elseif {$cmd == "fileattributes"} {
proc umount {local} {
foreach {db path} [mk::file open] {
if {[string equal $local $path]} {
- uplevel ::vfs::mk4::Unmount $db $local
+ uplevel 1 [list ::vfs::mk4::Unmount $db $local]
return
}
}
}
package ifneeded vfs 1.0 [list loadvfs $dll]
-
-package ifneeded mk4vfs 1.6 [list source [file join $dir mk4vfs.tcl]]
package ifneeded starkit 1.0 [list source [file join $dir starkit.tcl]]
package ifneeded vfslib 1.3 [list source [file join $dir vfslib.tcl]]
-package ifneeded tarvfs 0.1 [list source [file join $dir tarvfs.tcl]]
+# Old
+package ifneeded mk4vfs 1.6 [list source [file join $dir mk4vfs.tcl]]
package ifneeded zipvfs 1.0 [list source [file join $dir zipvfs.tcl]]
+
+# New
+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.6 [list source [file join $dir mk4vfs.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::urltype 1.0 [list source [file join $dir vfsUrl.tcl]]
+package ifneeded vfs::webdav 0.1 [list source [file join $dir webdavvfs.tcl]]
+package ifneeded vfs::zip 1.0 [list source [file join $dir zipvfs.tcl]]
################################################################################
package require vfs
-package provide tarvfs 0.1
+package provide vfs::tar 0.9
# Using the vfs, memchan and Trf extensions, we're able
# to write a Tcl-only tar filesystem.
+package provide vfs::ns 0.5
+
package require vfs 1.0
# Thanks to jcw for the idea here. This is a 'file system' which
+package provide vfs::test 1.0
+
package require vfs 1.0
namespace eval vfs::test {}
#
# % file copy ftp://ftp.ucsd.edu/pub/alpha/Readme .
+package provide vfs::urltype 1.0
+package require vfs
+
namespace eval ::vfs::urltype {}
proc vfs::urltype::Mount {type} {
# Find the highest level path so we can mount it:
set pathSplit [file split [file join $root $relative]]
set newRoot [eval [list file join] [lrange $pathSplit 0 1]]
- # Mount it.
::vfs::log [list $newRoot $pathSplit]
+ # Get the package we will need
+ ::package require vfs::${type}
+ # Mount it.
::vfs::${type}::Mount $newRoot $newRoot
# Now we want to find out the right handler
set typeHandler [::vfs::filesystem info $newRoot]
+package provide vfs::webdav 0.1
+
package require vfs 1.0
package require http 2.6
# part of tcllib
+package provide vfs::zip 1.0
+
package require vfs
package provide zipvfs 1.0
--- /dev/null
+#!/bin/sh
+# The next line is executed by /bin/sh, but not tcl \
+exec /usr/local/bin/tclsh8.4 $0 ${1+"$@"}
+
+
+proc platform {} {
+ global tcl_platform
+ set plat [lindex $tcl_platform(os) 0]
+ set mach $tcl_platform(machine)
+ switch -glob -- $mach {
+ sun4* { set mach sparc }
+ intel -
+ i*86* { set mach x86 }
+ "Power Macintosh" { set mach ppc }
+ }
+ return "$plat-$mach"
+}
+
+proc makepackagedirs {pkgname} {
+ file delete -force $pkgname
+ file mkdir $pkgname
+ file mkdir [file join $pkgname tcl]
+ file mkdir [file join $pkgname doc]
+ file mkdir [file join $pkgname examples]
+ file mkdir [file join $pkgname [platform]]
+ file mkdir [file join $pkgname tcl]
+}
+
+proc makepackage {pkgname} {
+ global files
+ makepackagedirs $pkgname
+
+ foreach type [array names files] {
+ foreach pat $files($type) {
+ foreach f [glob -nocomplain $pat] {
+ file copy $f [file join $pkgname $type]
+ }
+ }
+ }
+ file copy DESCRIPTION.txt $pkgname
+
+ if {![catch {package require installer}]} {
+ installer::mkIndex $pkgname
+ }
+}
+
+
+array set files {
+ tcl library/*.tcl
+ examples examples/*.tcl
+ doc {doc/*.n Readme.txt}
+}
+## how should files([platform]) be set?
+## the version number ought to be a param, needs to come fro
+## the config file: vfs_LIB_FILE
+
+if [catch {open config.status} config] {
+ error $config
+}
+
+while {[gets $config line] != -1} {
+ regexp -expanded {s(.)@vfs_LIB_FILE@\1(.*)\1} $line => sep files([platform])
+}
+close $config
+
+parray files
+
+
+makepackage vfs1.0