Does anyone know how to return file stats from an FTP session so that I can do a comparison on the original file size and the FTP'd file size? I have tried using 'stat' but ftp does not recognise this command? Here is what I've got so far which obviously does not work (fails on the ftp-> stat() line:
foreach (@files) {
$recv_name = $maindir.$outfile.$cnt.".cjj";
print "File $recv_name \n Press a key to continue\n";
getc;
if (/MYI/) {
print "\n Receiving file";
$ftp->get($_,$recv_name);
}
### Once received remove from the FTP server!
## But first validate the file size!!!
@filestat = stat($recv_name);
@filestft = $ftp->stat($_);
if ( -e $recv_name ) {
print "File exists. Check file size.";
}
if ( @filestat[11] = @filestft[11] ) {
$ftp->delete($_);
print "File Delete";
Any suggestions as how I could validate the ftp'd file with the one on the ftp server?
foreach (@files) {
$recv_name = $maindir.$outfile.$cnt.".cjj";
print "File $recv_name \n Press a key to continue\n";
getc;
if (/MYI/) {
print "\n Receiving file";
$ftp->get($_,$recv_name);
}
### Once received remove from the FTP server!
## But first validate the file size!!!
@filestat = stat($recv_name);
@filestft = $ftp->stat($_);
if ( -e $recv_name ) {
print "File exists. Check file size.";
}
if ( @filestat[11] = @filestft[11] ) {
$ftp->delete($_);
print "File Delete";
Any suggestions as how I could validate the ftp'd file with the one on the ftp server?