Hi everyone, I'm writing a script that will log into an FTP server, retrieve a list of files, then get modified time on that perticular file. For some reason, all my script does is return an empty variable. Here's what I have:
$ftp = Net::FTP->new($SERVER)
$ftp->login();
$ftp->binary();
@files = $ftp->ls();
foreach $cur_file (@files)
{
$file_date = $ftp->mdtm($cur_file);
print "$file_date $cur_file\n";
}
Now i'm only printing out the file_date so i can get the format returned for later evaluations. But right now it returns an invalid character or "". The CPAN Net::FTP manual says that the mdtm() function will return the "modification time" of the file passed. I've tried putting the $cur_file in quotes, i've even tried passing it the specific directory the list of files are in, but still no luck. Anyone know why this command isn't working or maybe another way of getting the modified time from a file through an ftp session?
B. Stopp
$ftp = Net::FTP->new($SERVER)
$ftp->login();
$ftp->binary();
@files = $ftp->ls();
foreach $cur_file (@files)
{
$file_date = $ftp->mdtm($cur_file);
print "$file_date $cur_file\n";
}
Now i'm only printing out the file_date so i can get the format returned for later evaluations. But right now it returns an invalid character or "". The CPAN Net::FTP manual says that the mdtm() function will return the "modification time" of the file passed. I've tried putting the $cur_file in quotes, i've even tried passing it the specific directory the list of files are in, but still no luck. Anyone know why this command isn't working or maybe another way of getting the modified time from a file through an ftp session?
B. Stopp