1Test::Smoke::FTPClient(U3s)er Contributed Perl DocumentatTieosnt::Smoke::FTPClient(3)
2
3
4

NAME

6       Test::Smoke::FTPClient - Implement a mirror like object
7

SYNOPSIS

9           use Test::Smoke::FTPClient;
10
11           my $server = 'ftp.linux.activestate.com';
12           my $fc = Test::Smoke::FTPClient->new( $server );
13
14           my $sdir = '/pub/staff/gsar/APC/perl-current';
15           my $ddir = '~/perlsmoke/perl-current';
16           my $cleanup = 1; # like --delete for rsync
17
18           $fc->connect;
19           $fc->mirror( $sdir, $ddir, $cleanup );
20
21           $fc->bye;
22

DESCRIPTION

24       This module was written specifically to fetch a perl source-tree from
25       the APC. It will not suffice as a general purpose mirror module!  It
26       only distinguishes between files and directories and relies on the
27       output of the "Net::FTP->dir" method.
28
29       This solution is slow, you'd better use rsync!
30

METHODS

32   Test::Smoke::FTPClient->new( $server[, %options] )
33       Create a new object with option checking:
34
35           * fuser
36           * fpasswd
37           * v
38           * fpassive
39           * ftype
40
41   $ftpclient->connect( )
42       Returns true for success after connecting and login.
43
44   $client->mirror( $sdir, $ddir )
45       Set-up the environment and call "__do_mirror()"
46
47   $client->bye
48       Disconnect from the FTP-server and cleanup the Net::FTP client;
49
50   Test::Smoke::FTPClient->config( $key[, $value] )
51       "config()" is an interface to the package lexical %CONFIG, which holds
52       all the default values for the "new()" arguments.
53
54       With the special key all_defaults this returns a reference to a hash
55       holding all the default values.
56
57   __do_mirror( $ftp, $ftpdir, $localdir, $lroot, $verbose, $cleanup )
58       Recursive sub to mirror a tree from an FTP server.
59
60   dirlist( $ftp, $verbose )
61       Return a list of entries (hashrefs) with these properties:
62
63           * name:    Filename
64           * type     f/d/l
65           * mode     unix file mode
66           * size     filessize in bytes
67           * date     file date
68
69   __parse_line_from_dir( $line, $verbose )
70       The "dir" command in FTP gives a sort of "ls -la" output, parts of this
71       output are used as remote file-info.
72
73   __get_mode_from_text( $tmode )
74       This takes the text representation of a file-mode (like 'rwxr--r--')
75       and return the numeric value.
76
77   __time_from_ls( $mname, $day, $time_or_year )
78       This takes the three date/time related columns from the "ls -la" output
79       and returns a localtime-stamp.
80
81   __time_from_windows( $date, $time )
82       This takes the two date/time related columns from the "dir" output and
83       returns a localtime-stamp
84

SEE ALSO

86       Test::Smoke::Syncer
87
89       (c) 2003, 2004, 2005, Abe Timmerman <abeltje@cpan.org> All rights
90       reserved.
91
92       This library is free software; you can redistribute it and/or modify it
93       under the same terms as Perl itself.
94
95       See:
96
97         * <http://www.perl.com/perl/misc/Artistic.html>,
98         * <http://www.gnu.org/copyleft/gpl.html>
99
100       This program is distributed in the hope that it will be useful, but
101       WITHOUT ANY WARRANTY; without even the implied warranty of
102       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
103
104
105
106perl v5.30.1                      2020-02-10         Test::Smoke::FTPClient(3)
Impressum