develooper Front page | perl.perl5.porters | Postings from September 2000

Mulriple File Transfers using NET::FTP module...

From:
John Ooko
Date:
September 5, 2000 17:19
Subject:
Mulriple File Transfers using NET::FTP module...
Message ID:
21DE0192983BD411B1E800D0B774648B594E@ACHILLES2.virtualvision.com
Hello,

Can someone out there help? I have written a small script below, to dowload
files for an FTP server. I employed the NET::FTP module. Somehow I cannot
find a command on NET::FTP that can allow mulriple file retieval using a
wildcard or other.

@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S "%0" %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
goto endofperl
@rem ';
#!perl
#line 14
use Net::FTP;

$ftp = Net::FTP->new
(
	"ftp.******** <ftp://ftp.********> ",
	Timeout => 30
) or die "Could not connect.\n";

$username = "*********";
$password = "*********";

$ftp->login($username, $password)
	or die "Could not log in.\n";

$ftp->cwd('.private/log');

$remotefile = "*******";
$localfile = "*******";

$ftp->retr($remotefile, $localfile)
	or die "Can not get file.\n";
__END__
:endofperl

Thanks in advance for your input.

John.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About