ftplib.FTP.dir()

FTP.dir(argument[, ...]) Produce a directory listing as returned by the LIST command, printing it to standard output. The optional argument is a directory to list (default is the current server directory). Multiple arguments can be used to pass non-standard options to the LIST command. If the last argument is a function, it is used as a callback function as for retrlines(); the default prints to sys.stdout. This method returns None. Note If your server supports the command, mlsd() offers a

ftplib.FTP.delete()

FTP.delete(filename) Remove the file named filename from the server. If successful, returns the text of the response, otherwise raises error_perm on permission errors or error_reply on other errors.

ftplib.FTP.cwd()

FTP.cwd(pathname) Set the current directory on the server.

ftplib.FTP.connect()

FTP.connect(host='', port=0, timeout=None, source_address=None) Connect to the given host and port. The default port number is 21, as specified by the FTP protocol specification. It is rarely needed to specify a different port number. This function should be called only once for each instance; it should not be called at all if a host was given when the instance was created. All other methods can only be used after a connection has been made. The optional timeout parameter specifies a timeout

ftplib.FTP.close()

FTP.close() Close the connection unilaterally. This should not be applied to an already closed connection such as after a successful call to quit(). After this call the FTP instance should not be used any more (after a call to close() or quit() you cannot reopen the connection by issuing another login() method).

ftplib.FTP.abort()

FTP.abort() Abort a file transfer that is in progress. Using this does not always work, but it’s worth a try.

ftplib.FTP

class ftplib.FTP(host='', user='', passwd='', acct='', timeout=None, source_address=None) Return a new instance of the FTP class. When host is given, the method call connect(host) is made. When user is given, additionally the method call login(user, passwd, acct) is made (where passwd and acct default to the empty string when not given). The optional timeout parameter specifies a timeout in seconds for blocking operations like the connection attempt (if is not specified, the global default t

ftplib.error_temp

exception ftplib.error_temp Exception raised when an error code signifying a temporary error (response codes in the range 400–499) is received.

ftplib.error_reply

exception ftplib.error_reply Exception raised when an unexpected reply is received from the server.

ftplib.error_proto

exception ftplib.error_proto Exception raised when a reply is received from the server that does not fit the response specifications of the File Transfer Protocol, i.e. begin with a digit in the range 1–5.