I have FTP Perl script and I want to make sure whether the file transfer is complete by checking the number of bytes that are transfered to the remote server is equal to the actual bytes of the file in the local server. How could i accomplish this?
Here's what I have so far:
my $ftp = Net::FTP->new($host, Debug => 1)
or die "Could not connect to '$host': $@";
$ftp->login($user, $pw)
or die sprintf "Could not login: %s", $ftp->message;
$ftp->cwd($path)
or die sprintf "Could not login: %s", $ftp->message;
$ftp->ls;
$ftp->binary;
$ftp->get($file)
or die sprintf "Could not login: %s", $ftp->message;