+2003-07-06 Vince Darley <vincentdarley@sourceforge.net>
+
+ * library/ftpvfs.tcl: fix to 'file stat' on a directory, which
+ fixes a variety of problems (e.g. recurisve 'file copy' in a
+ directory). Thanks to msofer for the detailed bug report and
+ test script.
+
2003-07-03 Vince Darley <vincentdarley@sourceforge.net>
* library/ftpvfs.tcl: added support for ports other than 21,
set port 21
}
- set fd [::ftp::Open $host $user $pass -port $port -output ::vfs::log]
+ set fd [::ftp::Open $host $user $pass -port $port -output ::vfs::ftp::log]
if {$fd == -1} {
error "Mount failed"
}
return $fd
}
+# Need this because vfs::log takes just one argument
+proc vfs::ftp::log {args} {
+ ::vfs::log $args
+}
+
proc vfs::ftp::Unmount {fd local} {
vfs::filesystem unmount $local
::ftp::Close $fd
::vfs::log $ftpInfo
set perms [lindex $ftpInfo 0]
if {[string index $perms 0] == "d"} {
- lappend res type directory
+ lappend res type directory size 0
set mtime 0
} else {
- lappend res type file
+ lappend res type file size [ftp::FileSize $fd $name]
set mtime [ftp::ModTime $fd $name]
}
lappend res dev -1 uid -1 gid -1 nlink 1 depth 0 \
- atime $mtime ctime $mtime mtime $mtime mode 0777 \
- size [ftp::FileSize $fd $name]
+ atime $mtime ctime $mtime mtime $mtime mode 0777
return $res
}
}
proc vfs::ftp::matchindirectory {fd path actualpath pattern type} {
- ::vfs::log "matchindirectory $path $pattern $type"
+ ::vfs::log "matchindirectory $fd $path $actualpath $pattern $type"
set res [list]
if {![string length $pattern]} {
# matching a single file