APIFTP store

FTP store

Accesses a folder store over FTP.

Instance creation

my $ftpStore = CDS::FTPStore->forUrl($url);

Instantiates a FTP store for a url of the form:

ftp://HOST:PORT/PATH/TO/STORE

The port is optional, and defaults to 21.

my $ftpStore = CDS::FTPStore->new($endPoint, $folder);

Instantiates a FTP store. End point is the hostname or IP address to connect to, and folder denotes the path to the store folder on that server.

Store behavior

A FTP connection is opened with the first request, and all store requests are handled through that connection.

A store request typically results in several FTP requests, involving several round trip times (RTTs). Hence, FTP stores are not particularly efficient.

Administration

my @accountHashes = $ftpStore->accounts;

Returns the list of accounts. Each account is a hash.

my $ok = $ftpStore->addAccount($accountHash);

Adds an account by creating its account and (empty) box folders.

my $ok = $ftpStore->removeAccount($accountHash);

Removes an account and deletes its boxes.

Removal is done in two steps: the account folder is first renamed to ".deleted-RANDOMSEQUENCE", and then removed. If removal fails, an obsolete ".deleted-RANDOMSEQUENCE" folder will remain, which can safely be removed manually by an administrator.

The FTP store is currently only implemented in Perl.

See also

Minimalistic FTP Server