+2003-02-21 Vince Darley <vincentdarley@sourceforge.net>
+
+ * doc/vvs.n:
+ * library/*.tcl: added missing 'recursive' flag to most
+ .tcl 'removedirectory' implementations.
+
2003-02-21 Vince Darley <vincentdarley@sourceforge.net>
* generic/vfs.c: some small cleanup
script has been specified, when they are passed to that script for
further action.
.TP
-\fIcommand\fR \fIremovedirectory\fR \fIr-r-a\fR
-Delete the given directory.
+\fIcommand\fR \fIremovedirectory\fR \fIr-r-a\fR \fIrecursive\fR
+Delete the given directory. \fIrecursive\fR is either 0 or 1. If
+it is 1 then even if the directory is non-empty, an attempt should
+be made to recursively delete it and its contents. If it is 0 and
+the directory is non-empty, a posix error (ENOTEMPTY) should be
+thrown.
.TP
\fIcommand\fR \fIstat\fR \fIr-r-a\fR
Return a list of even length containing field-name and value pairs for
}
# get information on the type of this file
set ftpInfo [_findFtpInfo $fd $name]
- if {$ftpInfo == ""} { error "Couldn't find file info" }
+ if {$ftpInfo == ""} {
+ vfs::filesystem posixerror $::vfs::posix(ENOENT)
+ }
::vfs::log $ftpInfo
set perms [lindex $ftpInfo 0]
if {[string index $perms 0] == "d"} {
if {[string length $info]} {
return 1
} else {
- error "No such file"
+ vfs::filesystem posixerror $::vfs::posix(ENOENT)
}
}
::ftp::Type $fd binary
}
if {![::ftp::$action $fd -data $contents $name]} {
- error "Failed to write to $name"
+ # Would be better if we could be more specific here, with
+ # one of ENETRESET ENETDOWN ENETUNREACH or whatever.
+ vfs::filesystem posixerror $::vfs::posix(EIO)
+ #error "Failed to write to $name"
}
if {[info exists oldType]} {
::ftp::Type $fd $oldType
}
}
-proc vfs::ftp::removedirectory {fd name} {
- ::vfs::log "removedirectory $name"
+proc vfs::ftp::removedirectory {fd name recursive} {
+ ::vfs::log "removedirectory $name $recursive"
if {![ftp::RmDir $fd $name]} {
error "failed"
}
proc vfs::ftp::deletefile {fd name} {
::vfs::log "deletefile $name"
if {![ftp::Delete $fd $name]} {
+ # Can we be more specific here?
error "failed"
}
}
1 {
# get value
set index [lindex $args 0]
+ vfs::filesystem posixerror $::vfs::posix(ENODEV)
}
2 {
# set value
set index [lindex $args 0]
set val [lindex $args 1]
+ vfs::filesystem posixerror $::vfs::posix(ENODEV)
}
}
}
vfs::filesystem posixerror $::vfs::posix(EROFS)
}
-proc vfs::http::removedirectory {dirurl name} {
+proc vfs::http::removedirectory {dirurl name recursive} {
::vfs::log "removedirectory $name"
vfs::filesystem posixerror $::vfs::posix(EROFS)
}
#error "tar-archives are read-only (not implemented)"
}
-proc vfs::tar::removedirectory {tarfd name} {
+proc vfs::tar::removedirectory {tarfd name recursive} {
#::vfs::log "removedirectory $name"
vfs::filesystem posixerror $::vfs::posix(EROFS)
#error "tar-archives are read-only (not implemented)"
namespace eval ::${ns}::${name} {}
}
-proc vfs::ns::removedirectory {ns name} {
+proc vfs::ns::removedirectory {ns name recursive} {
::vfs::log "removedirectory $name"
namespace delete ::${ns}::${name}
}
puts "createdirectory $name"
}
-proc vfs::test::removedirectory {what name} {
+proc vfs::test::removedirectory {what name recursive} {
puts "removedirectory $name"
}
error ""
}
-proc vfs::urltype::removedirectory {type root name} {
+proc vfs::urltype::removedirectory {type root name recursive} {
::vfs::log "removedirectory $name"
# For ftp/http/file types we don't want to allow anything here.
error ""
error "write access not implemented"
}
-proc vfs::webdav::removedirectory {dirurl extraHeadersList name} {
+proc vfs::webdav::removedirectory {dirurl extraHeadersList name recursive} {
::vfs::log "removedirectory $name"
error "write access not implemented"
}
vfs::filesystem posixerror $::vfs::posix(EROFS)
}
-proc vfs::zip::removedirectory {zipfd name} {
+proc vfs::zip::removedirectory {zipfd name recursive} {
#::vfs::log "removedirectory $name"
vfs::filesystem posixerror $::vfs::posix(EROFS)
}