in reply to FTP Transfer Status

I did it like this, using Net::FTP and without having to modify it:

use Net::FTP; use IO::Callback; my $BytesPerHash = 2048; my $HashHandle = IO::Callback->new('>', sub { # activity code # called every $BytesPerHash } ); my $ftp = Net::FTP->new($host, Timeout => $Timeout); $ftp->hash($HashHandle, $BytesPerHash); $ftp->login($Username, $Password); $ftp->binary; $ftp->put($localFile, $remoteFile); [...]

Works nicely

Replies are listed 'Best First'.
Re^2: FTP Transfer Status
by Anonymous Monk on May 30, 2016 at 14:43 UTC
    This code works but it's kinda different from sending the hash to the console.

    Let's say normally you'd get around 10 hash marks, using this code you get 1, I don't have a clue what influences this but every hask mark represents 10 of the normal hash using this