Standard documentation appears at http://tcllib.sourceforge.net/doc/ftp.html . Related pages: * [Tcllib] * [Expect] (Expect? Yes, many programmers think they need to use Expect to automate FTP operations, and don't realize that the ftp package is not just an alternative, but an '''easier''' one) * [VFS] * [Inventory of IPC methods] * [Interacting with the internet] * [ftpd] * [Patrick Finnegan] points out that [TclCurl] makes for a convenient way to enable host-specific or "native" FTP commands--but note the availability of '''ftp::Quote'''. ---- Here's an example implementation of a "deep" listing, which recurses into subdirectories: proc deep_list {host user pass dir} { set handle [::ftp::Open $host $user $pass] # An alternative would be to "::ftp::Cd ... $dir", # then "::ftp::DeepList $handle .", then strip # off the leading "./" (or equivalent). That # gives a slightly different format. I'm not # sure which has superior aesthetics. set result [::ftp::DeepList $handle $dir] ::ftp::Close $handle return $result } proc ::ftp::DeepList {handle directory} { set result {} set original [::ftp::Pwd $handle] foreach item [::ftp::NList $handle $directory/*] { # Why two clauses in the predicate? Because, # depending on the (run-time) value of # $::ftp::VERBOSE, we might receive either # an exception, or a return value. We need # to handle either case gracefully. if {[catch {::ftp::Cd $handle $item} ret_val] || !$ret_val} { lappend result $item } else { ::ftp::Cd $handle $original set result [concat $result [::ftp::DeepList $handle $item]] } } return [lsort $result] } Use this as set list_of_files [deep_list $host $user $pass $directory] /* As a cut and paste code snippet it failed for me. The procedure deep_list_i is undefined. Art Morel art@rain.org */ the previous proc was named deep_list_i just change that to ::ftp::DeepList and it should work ---- Commentary on the history of FTP specifications appear at http://www.wu-ftpd.org/rfc/ . ---- These days (21th century) system administrators have started shutting down FTP access for security reasons. A rather different protocol which could provide an alternative is [fish]. ---- [Category Package] (sub-package of [Tcllib]) - [Category Internet]