Student Of Perl wrote:
> 
> use Net::FTP;
> 
> use constant HOST=>'ftp.somexample.com';
> $ftp=Net::FTP->new(HOST) or die "connection error";
> $ftp->login('anonymous') or die $ftp->message;
> $ftp->binary or die $ftp->message;
> $ftp->get("sample.txt") or die $ftp->message;
> $ftp->quit();
> 
> I have the above script created.The site and file names
> I have taken as an arbitrary examples. Basically I have
> 2 questions.
> 
> How do I get date and time of the remote ftp file?

my $remote_file_date = $ftp->mdtm( $remote_file );


> How do I get date and time of local file?

my $local_file_date = (stat $local_file)[9];


> (This is not related with the above code directly;
> basically I want to compare date and time of local
> and remote files)
> 
> And how to set date and time for local file?
> I would like to set any date for a local file.

my $today = time;
utime $today, $today, $local_file;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to