ftp Library Package 2.1 for Tcl/Tk Manual Pages
The listing includes any system-dependent information that the server chooses to include; for example, most UNIX systems produce output from the command "ls -l". ftp::List returns these information as a tcl list with one line for every entry. Empty lines and UNIX's "total" lines are ignored. So it should offer only usable informations.
If the command fails an empty list is returned.
# list current directory
foreach line [ftp::List $conn]
puts $line
}
# list only tcl files
foreach line [ftp::List $conn *.tcl]
puts $line
}
# list specified directory
set dir_list [ftp::List $conn /pub/usr/lib]
# list if directory exist
if {[ftp::Cd $conn /pub/usr/lib]} {
set dir_list [ftp::List $conn]
} else {
puts "Directory doesn't exist!"
}
[Contents] [Previous: ftp::Type] [Next: ftp::NList]