I'm using Net::FTP::Foreign and I keep getting an error about file not being found and I'm not sure if my syntax is wrong or I'm misunderstanding how to use it.
$LOGFILE = 'data_log' . $YYYYMMDD . '.log';
$sftp->setcwd('/tmp')
or die 'Unable to change working directory to /tmp: ' . $sftp->error;
print "CWD set\n";
my $ls = $sftp->ls('/tmp', names_only => 1, ordered => 1);
foreach my $file (@$ls) {
print $file . "\n";
}
print 'Getting file: ' . $LOGFILE . "\n";
$sftp->get('/tmp/data_log*', 'data_log' . $YYYYMMDD . 'log')
or die 'Could not get remote file: ' . $sftp->error;
The error I get is that no such files exist on the remote side but I've confirmed that they do exist when I do the LS cmd.
Is there anything blatantly wrong with my script which is causing it to not work?
Also I'm using Net::SFTP::Foreign because Net::SFTP won't build on my MBP running 10.7