Anyone experienced with Net::Ftp ??
I'm trying to do a transfer, but there seems to be a problem in the $ftp->cwd();.
1. $ftp->ls() doesn't see the symbolic links, when using $ftp->dir() symbolic links will be shown.
Pretty much what I' trying to do is this, once I connect and change my directory in the ftp i gotta check if the directory where I want to transfer is a regular directory or a symbolic lynk. If its a symbolic link, I should just follow it and do the transfer.
Code:
$ftp = Net::FTP::Recursive->new($config{'host'}, isSymlink => 1, Debug => 1);
$ftp->login( $config{'user'}, $config{'pass'});
$ftp->cwd( $config{'trgt'});
my @listClients = $ftp->ls();
foreach $x (@listClients){
if (-l $x){
print "Inside link test ".$x."\n";
if (defined($clientLink = readlink($ftp->pwd()."/".$x))) {
print "\t\t".$clientLink."\n";
$ftp-> cwd( $clientLink );
print $ftp->pwd();
}
} else {
$ftp->cwd( $client );
}
}
$ftp->binary(); #Set Binary mode
$ftp->rput();
$ftp->quit;
Thanks in advance for any help.