ftplib.FTP.nlst()

FTP.nlst(argument[, ...]) Return a list of file names as returned by the NLST command. 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 NLST command. Note If your server supports the command, mlsd() offers a better API.

ftplib.FTP.rename()

FTP.rename(fromname, toname) Rename file fromname on the server to toname.

ftplib.FTP.retrbinary()

FTP.retrbinary(cmd, callback, blocksize=8192, rest=None) Retrieve a file in binary transfer mode. cmd should be an appropriate RETR command: 'RETR filename'. The callback function is called for each block of data received, with a single string argument giving the data block. The optional blocksize argument specifies the maximum chunk size to read on the low-level socket object created to do the actual transfer (which will also be the largest size of the data blocks passed to callback). A rea

ftplib.FTP.ntransfercmd()

FTP.ntransfercmd(cmd, rest=None) Like transfercmd(), but returns a tuple of the data connection and the expected size of the data. If the expected size could not be computed, None will be returned as the expected size. cmd and rest means the same thing as in transfercmd().

ftplib.FTP.mlsd()

FTP.mlsd(path="", facts=[]) List a directory in a standardized format by using MLSD command (RFC 3659). If path is omitted the current directory is assumed. facts is a list of strings representing the type of information desired (e.g. ["type", "size", "perm"]). Return a generator object yielding a tuple of two elements for every file found in path. First element is the file name, the second one is a dictionary containing facts about the file name. Content of this dictionary might be limited

ftplib.FTP.quit()

FTP.quit() Send a QUIT command to the server and close the connection. This is the “polite” way to close a connection, but it may raise an exception if the server responds with an error to the QUIT command. This implies a call to the close() method which renders the FTP instance useless for subsequent calls (see below).

ftplib.FTP.pwd()

FTP.pwd() Return the pathname of the current directory on the server.

ftplib.FTP.getwelcome()

FTP.getwelcome() Return the welcome message sent by the server in reply to the initial connection. (This message sometimes contains disclaimers or help information that may be relevant to the user.)

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.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