Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Download progress for SFTP mput

by Anonymous Monk
on May 01, 2013 at 15:22 UTC ( #1031588=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I am using Net::SFTP::Foreign; and trying to get the download/upload progress meter using $sftp->mput($abslocalfile,$absremotefile,callback => \&callback,copy_perm => 0,copy_time => 0) I am getting error "Invalid option 'callback' or bad combination of options at perl/sftp/ line 147" The same work fine for put option $sftp->put($abslocalfile,$absremotefile,callback => \&callback,copy_perm => 0,copy_time => 0) Appreciate any help on this thanks SSB

Replies are listed 'Best First'.
Re: Download progress for SFTP mput
by kcott (Canon) on May 01, 2013 at 16:05 UTC

    Looking at the Net::SFTP::Foreign Source, it would appear that callback is not a valid option for mput():

    sub mput { ... my ($sftp, $local, $remotedir, %opts) = @_; ... my $ignore_links = delete $opts{ignore_links}; my %glob_opts = (map { $_ => delete $opts{$_} } qw(on_error follow_links ignore_case wanted no_wanted strict_leading_dot)); ... my %put_opts = (map { $_ => delete $opts{$_} } qw(umask perm copy_perm copy_time block_size queue_size overwrite conversion resume numbered late_set_p +erm atomic best_effort sparse)); %opts and _croak_bad_options(keys %opts); ...

    However, put() does accept callback (as well as copy_perm and copy_time):

    sub put { ... my $cb = delete $opts{callback}; ... my $copy_perm = delete $opts{copy_perm}; ... my $copy_time = delete $opts{copy_time}; ...

    -- Ken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1031588]
Approved by kcott
Front-paged by toolic
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2017-03-28 01:19 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (326 votes). Check out past polls.