Test::S...PClient(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

πŸ’– 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:

  • fuser
  • fpasswd
  • v
  • fpassive
  • ftype

πŸ’œ $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: Filename
  • type β€” f/d/l
  • mode β€” unix file mode
  • size β€” filessize in bytes
  • date β€” 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 πŸ“š


(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