Welcome to ftpext’s documentation!

Contents:

ftpext – Main package

class ftpext.ftpext.FTPExt(host, port, user, password, use_ssl=False, use_log=False, debug=0)[source]

Bases: ftplib.FTP_TLS

Extensions to the ‘ftplib’ standard library. Features include: XDUPE support. Stat -L directory listing support. FXP-support CPSV/PSV. Logging and other useful features, have a look yourself.

I’ve made the getter functions thread-safe to make multiple objects easier to handle. It inherits from ftplib.FTP_TLS which means that it supports AUTH TLS and Clear Text, which to use is specified when the object is initialized.

disable_pret()[source]

Disable pre transfer support. http://www.drftpd.org/index.php/PRET_Specifications

disable_xdupe()[source]

Enable XDUPE support. http://www.smartftp.com/static/Products/SmartFTP/RFC/x-dupe-info.txt

enable_pret()[source]

Enable pre transfer support http://www.drftpd.org/index.php/PRET_Specifications

enable_xdupe()[source]

Enable XDUPE support. http://www.smartftp.com/static/Products/SmartFTP/RFC/x-dupe-info.txt

fxp_to(file, target, target_file=None, type='I')[source]

FXP (server-to-server-copy) a file between 2 servers.

last_command[source]

The last command that was sent to the server.

last_response[source]

The last response received from the server.

log[source]

Log with all server communication

ls()[source]

Get directory list via STAT -L command. Returns a dict where the keys are the filenames and the value is information about the file/directory.

secure_fxp_to(file, target, target_file=None, type='I')[source]

FXP (server-to-server-copy) a file between 2 servers. This uses CPSV instead of PASV to fxp file with SSL encryption

xdupes[source]

List of dupes, if xdupe is enabled then each time the server returns an 553 (xdupe) response this variable will be populated with the dupe filenames