Subject: | automatic pret support ? |
automatic pret support ?
See the example (little hack with goto) but it works.
Subject: | ftp.pl |
#!/usr/bin/perl
use Net::FTPSSL;
my $host = 'localhost';
my $port = '33333';
my $user = 'test';
my $pass = 'test';
my $pfad = '/';
my $ftppret1 = 0;
FTPPRET1:
if(my $ftp = Net::FTPSSL->new($host, Timeout => 10, Pret => $ftppret1, Port => $port, Debug => 0)){
$ftp->login($user,$pass);
$ftp->binary();
$ftp->cwd($pfad);
my @ftpdataLIST = $ftp->list($pfad);
if($ftp->last_message() =~ /You need to use a client supporting PRET/i){
$ftp->abort;
$ftp->quit;
$ftppret1 = 1;
goto FTPPRET1;
}
# Code
$ftp->quit;
}
exit;