toil.lib.ftp_utils

Attributes

logger

Classes

FtpFsAccess

FTP access with upload.

Module Contents

toil.lib.ftp_utils.logger
class toil.lib.ftp_utils.FtpFsAccess(cache=None)[source]

FTP access with upload.

Taken and modified from https://github.com/ohsu-comp-bio/cwl-tes/blob/03f0096f9fae8acd527687d3460a726e09190c3a/cwl_tes/ftp.py#L37-L251

Parameters:

cache (Optional[dict[Any, ftplib.FTP]])

cache
netrc = None
exists(fn)[source]

Check if a file/directory exists over an FTP server :param fn: FTP url :return: True or false depending on whether the object exists on the server

Parameters:

fn (str)

Return type:

bool

isfile(fn)[source]

Check if the FTP url points to a file :param fn: FTP url :return: True if url is file, else false

Parameters:

fn (str)

Return type:

bool

isdir(fn)[source]

Check if the FTP url points to a directory :param fn: FTP url :return: True if url is directory, else false

Parameters:

fn (str)

Return type:

bool

open(fn, mode)[source]

Open an FTP url.

Only supports reading, no write support. :param fn: FTP url :param mode: Mode to open FTP url in :return:

Parameters:
Return type:

IO[bytes]

size(fn)[source]

Get the size of an FTP object :param fn: FTP url :return: Size of object

Parameters:

fn (str)

Return type:

Optional[int]