FTP Library Package 1.2 for Tcl/Tk Manual Pages
The FTP::Open command takes a host name server, a user name
user and a password password as its parameters and returns
"1" if the connections is successfully established, otherwise it
returns "0".
The server parameter must be the name or internet address (in dotted decimal
notation) of the ftp server. The user and passwd parameters must contain a
valid user name and password to complete the login process.
-blocksize size
-timeout seconds
-port number
-mode mode
-progress callback
proc Progress {total} { puts "$total bytes transfered!" }
set server "ftp.server.com" set user "anonymous" set passwd "mist@foo.com" # define callback proc Progress {total} { puts "$total bytes transfered!" } # open a new connection if {![FTP::Open $server $user $passwd -progress Progress -blocksize 1024 -mode passive]} { puts "Connection refused!" exit 1 } # get a file FTP::Get index.html # close connection FTP::Close
[Contents] [Next: FTP::Close]