-
-
30 Mar 2022 09:25:47 UTC
- Distribution: Test-Smoke
- Module version: 0.011
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (24)
- Testers (237 / 5 / 0)
- Kwalitee
Bus factor: 2- 65.73% Coverage
- License: perl_5
- Perl: v5.10.0
- Activity
24 month- Tools
- Download (358.2KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- CGI::Util
- Capture::Tiny
- File::Spec
- HTTP::Tiny
- JSON::XS
- POSIX
- System::Info
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- SYNOPSIS
- DESCRIPTION
- METHODS
- Test::Smoke::FTPClient->new( $server[, %options] )
- $ftpclient->connect( )
- $client->mirror( $sdir, $ddir )
- $client->bye
- Test::Smoke::FTPClient->config( $key[, $value] )
- __do_mirror( $ftp, $ftpdir, $localdir, $lroot, $verbose, $cleanup )
- dirlist( $ftp, $verbose )
- __parse_line_from_dir( $line, $verbose )
- __get_mode_from_text( $tmode )
- __time_from_ls( $mname, $day, $time_or_year )
- __time_from_windows( $date, $time )
- SEE ALSO
- COPYRIGHT & LICENSE
NAME
Test::Smoke::FTPClient - Implement a mirror like object
SYNOPSIS
use Test::Smoke::FTPClient; my $server = 'ftp.linux.activestate.com'; my $fc = Test::Smoke::FTPClient->new( $server ); my $sdir = '/pub/staff/gsar/APC/perl-current'; my $ddir = '~/perlsmoke/perl-current'; my $cleanup = 1; # like --delete for rsync $fc->connect; $fc->mirror( $sdir, $ddir, $cleanup ); $fc->bye;
DESCRIPTION
This module was written specifically to fetch a perl source-tree from the APC. It will not suffice as a general purpose mirror module! It only distinguishes between files and directories and relies on the output of the
Net::FTP->dir
method.This solution is slow, you'd better use rsync!
METHODS
Test::Smoke::FTPClient->new( $server[, %options] )
Create a new object with option checking:
* fuser * fpasswd * v * fpassive * ftype
$ftpclient->connect( )
Returns true for success after connecting and login.
$client->mirror( $sdir, $ddir )
Set-up the environment and call
__do_mirror()
$client->bye
Disconnect from the FTP-server and cleanup the Net::FTP client;
Test::Smoke::FTPClient->config( $key[, $value] )
config()
is an interface to the package lexical%CONFIG
, which holds all the default values for thenew()
arguments.With the special key all_defaults this returns a reference to a hash holding all the default values.
__do_mirror( $ftp, $ftpdir, $localdir, $lroot, $verbose, $cleanup )
Recursive sub to mirror a tree from an FTP server.
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
__parse_line_from_dir( $line, $verbose )
The
dir
command in FTP gives a sort ofls -la
output, parts of this output are used as remote file-info.__get_mode_from_text( $tmode )
This takes the text representation of a file-mode (like 'rwxr--r--') and return the numeric value.
__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-stampSEE ALSO
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:
* <http://www.perl.com/perl/misc/Artistic.html>, * <http://www.gnu.org/copyleft/gpl.html>
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.
Module Install Instructions
To install Test::Smoke, copy and paste the appropriate command in to your terminal.
cpanm Test::Smoke
perl -MCPAN -e shell install Test::Smoke
For more information on module installation, please visit the detailed CPAN module installation guide.