FTP Objects

FTP instances have the following methods:
\begin{funcdesc}{set_debuglevel}{level}
Set the instance's debugging level. This...
...t, logging each line sent and
received on the control connection.
\end{funcdesc}

\begin{funcdesc}{connect}{host\optional{\, port}}
Connect to the given host and ...
... other methods can only be
used after a connection has been made.
\end{funcdesc}

\begin{funcdesc}{getwelcome}{}
Return the welcome message sent by the server in ...
...isclaimers or help
information that may be relevant to the user.)
\end{funcdesc}

\begin{funcdesc}{login}{\optional{user\optional{\, passwd\optional{\, acct}}}}
L...
...ost FTP commands are only allowed after the
client has logged in.
\end{funcdesc}

\begin{funcdesc}{abort}{}
Abort a file transfer that is in progress. Using this does not always
work, but it's worth a try.
\end{funcdesc}

\begin{funcdesc}{sendcmd}{command}
Send a simple command string to the server and return the response
string.
\end{funcdesc}

\begin{funcdesc}{voidcmd}{command}
Send a simple command string to the server an...
... in the range 200--299 is received.
Raise an exception otherwise.
\end{funcdesc}

\begin{funcdesc}{retrbinary}{command\, callback\, maxblocksize}
Retrieve a file ...
... be the actual size of the data blocks passed to
\var{callback}).
\end{funcdesc}

\begin{funcdesc}{retrlines}{command\optional{\, callback}}
Retrieve a file or di...
... The default \var{callback} prints
the line to \code{sys.stdout}.
\end{funcdesc}

\begin{funcdesc}{storbinary}{command\, file\, blocksize}
Store a file in binary ...
... blocks of size \var{blocksize} to provide the
data to be stored.
\end{funcdesc}

\begin{funcdesc}{storlines}{command\, file}
Store a file in \ASCII{} transfer mo...
...ng its
\code{readline()} method to privide the data to be stored.
\end{funcdesc}

\begin{funcdesc}{nlst}{argument\optional{\, \ldots}}
Return a list of files as r...
... be used to pass
non-standard options to the \samp{NLST} command.
\end{funcdesc}

\begin{funcdesc}{dir}{argument\optional{\, \ldots}}
Return a directory listing a...
...t is used as a \var{callback} function
as for \code{retrlines()}.
\end{funcdesc}

\begin{funcdesc}{rename}{fromname\, toname}
Rename file \var{fromname} on the server to \var{toname}.
\end{funcdesc}

\begin{funcdesc}{cwd}{pathname}
Set the current directory on the server.
\end{funcdesc}

\begin{funcdesc}{mkd}{pathname}
Create a new directory on the server.
\end{funcdesc}

\begin{funcdesc}{pwd}{}
Return the pathname of the current directory on the server.
\end{funcdesc}

\begin{funcdesc}{quit}{}
Send a \samp{QUIT} command to the server and close the ...
...n of the server reponds with an error to the \code{QUIT}
command.
\end{funcdesc}

\begin{funcdesc}{close}{}
Close the connection unilaterally. This should not be ...
...losed connection (e.g.\ after a successful call to
\code{quit()}.
\end{funcdesc}