Test::S...PClient(3)
π NAME π
Test::Smoke::FTPClient β bestie, it implements a mirror like object πͺβ¨ (yes that's really the whole vibe, no cap)
πΈ SYNOPSIS πΈ
okay so like, here's how you actually use this thing:
use Test::Smoke::FTPClient;
my $server = 'ftp.example.com';
my $fc = Test::Smoke::FTPClient->new( $server );
my $sdir = '/';
my $ddir = '~/perlsmoke/perl-current';
my $cleanup = 1; # like --delete for rsync
$fc->connect;
$fc->mirror( $sdir, $ddir, $cleanup );
$fc->bye;
look at that. iconic. π
π¦ DESCRIPTION π¦
This solution is slow, you'd better use rsync! π fr fr, the manpage itself is telling you. not me exposing the author like this, but they said it first.
β¨ METHODS β¨
π Test::Smoke::FTPClient->new( $server[, %options] )
Create a new object with option checking, babes. the options it's checking for are:
fuserfpasswdvfpassiveftype
π $ftpclient->connect( )
Returns true for success after connecting and login. so like, if it's true, you're in. π«Ά
β $client->mirror( $sdir, $ddir )
Set-up the environment and call __do_mirror(). that's the whole job bestie.
π $client->bye
Disconnect from the FTP-server and cleanup the Net::FTP client. say bye bye ππ
π§ Test::Smoke::FTPClient->config( $key[, $value] )
config() is an interface to the package lexical %CONFIG, which holds all the default values for the new() arguments. lowkey the source of truth.
With the special key all_defaults this returns a reference to a hash holding all the default values. so if you wanna peek at everything at once, that's your girl. π
π₯ __do_mirror( $ftp, $ftpdir, $localdir, $lroot, $verbose, $cleanup )
Recursive sub to mirror a tree from an FTP server. it's giving recursion. it's giving tree. π³
π« dirlist( $ftp, $verbose )
Return a list of entries (hashrefs) with these properties:
name: Filenametypeβf/d/lmodeβ unix file modesizeβ filessize in bytesdateβ file date
(yes, filessize is spelled exactly like that in the original, we don't fix what the author wrote π)
π __parse_line_from_dir( $line, $verbose )
The dir command in FTP gives a sort of ls -la output, parts of this output are used as remote file-info. so it's basically doing detective work on some text. π΅οΈββοΈ
πΈ __get_mode_from_text( $tmode )
This takes the text representation of a file-mode (like 'rwxr--r--') and return the numeric value. translating vibes into numbers, slay. π’
π¦ __time_from_ls( $mname, $day, $time_or_year )
This takes the three date/time related columns from the ls -la output and returns a localtime-stamp. β°
π«§ __time_from_windows( $date, $time )
This takes the two date/time related columns from the dir output and returns a localtime-stamp. windows edition, we love her too. π»
π SEE ALSO π
Test::Smoke::Syncer
go read that one too bestie, iykyk π
π COPYRIGHT & LICENSE π
(c) 2003, 2004, 2005, Abe Timmerman <abeltje@cpan.org> All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. so like, no promises babe π
and that's the whole page, periodt π
β¨ this was perl v5.42.0, dated 2025-07-25, and it's the user contributed perl documentation for Test::S...PClient(3) β mwah, go mirror something, ily π«Άπ
π¦ where this page comes from
- fedora 43: perl-Test-Smoke 1.84-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms