ftplib.FTP.voidcmd()

FTP.voidcmd(cmd) Send a simple command string to the server and handle the response. Return nothing if a response code corresponding to success (codes in the range 200–299) is received. Raise error_reply otherwise.

ftplib.FTP.transfercmd()

FTP.transfercmd(cmd, rest=None) Initiate a transfer over the data connection. If the transfer is active, send an EPRT or PORT command and the transfer command specified by cmd, and accept the connection. If the server is passive, send an EPSV or PASV command, connect to it, and start the transfer command. Either way, return the socket for the connection. If optional rest is given, a REST command is sent to the server, passing rest as an argument. rest is usually a byte offset into the reques

ftplib.FTP.storlines()

FTP.storlines(cmd, fp, callback=None) Store a file in ASCII transfer mode. cmd should be an appropriate STOR command (see storbinary()). Lines are read until EOF from the file object fp (opened in binary mode) using its readline() method to provide the data to be stored. callback is an optional single parameter callable that is called on each line after it is sent.

ftplib.FTP.storbinary()

FTP.storbinary(cmd, fp, blocksize=8192, callback=None, rest=None) Store a file in binary transfer mode. cmd should be an appropriate STOR command: "STOR filename". fp is a file object (opened in binary mode) which is read until EOF using its read() method in blocks of size blocksize to provide the data to be stored. The blocksize argument defaults to 8192. callback is an optional single parameter callable that is called on each block of data after it is sent. rest means the same thing as in

ftplib.FTP.size()

FTP.size(filename) Request the size of the file named filename on the server. On success, the size of the file is returned as an integer, otherwise None is returned. Note that the SIZE command is not standardized, but is supported by many common server implementations.

ftplib.FTP.set_pasv()

FTP.set_pasv(boolean) Enable “passive” mode if boolean is true, other disable passive mode. Passive mode is on by default.

ftplib.FTP.set_debuglevel()

FTP.set_debuglevel(level) Set the instance’s debugging level. This controls the amount of debugging output printed. The default, 0, produces no debugging output. A value of 1 produces a moderate amount of debugging output, generally a single line per request. A value of 2 or higher produces the maximum amount of debugging output, logging each line sent and received on the control connection.

ftplib.FTP.sendcmd()

FTP.sendcmd(cmd) Send a simple command string to the server and return the response string.

ftplib.FTP.rmd()

FTP.rmd(dirname) Remove the directory named dirname on the server.

ftplib.FTP.retrlines()

FTP.retrlines(cmd, callback=None) Retrieve a file or directory listing in ASCII transfer mode. cmd should be an appropriate RETR command (see retrbinary()) or a command such as LIST or NLST (usually just the string 'LIST'). LIST retrieves a list of files and information about those files. NLST retrieves a list of file names. The callback function is called for each line with a string argument containing the line with the trailing CRLF stripped. The default callback prints the line to sys.std