in reply to Re^6: Perl sftp behavior when there are no files in the share
in thread Perl sftp behavior when there are no files in the share
This is untested, because I haven't yet figured out how to use cpan with the perl interpreter on my smartphone :-)
First you need the callback routine, like this:
The \r positions the cursor to the beginning of the line, so that the next print overwrites it.sub show_progress { my($sftp, $data, $offset, $size) = @_; print "downloaded $offset of $size bytes\r"; }
Then you change
to$sftp->get($REM_FILE)
That should do the trick...$sftp->get($REM_FILE, callback => \&show_progress)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^8: Perl sftp behavior when there are no files in the share
by Bindo (Acolyte) on Mar 28, 2013 at 12:50 UTC | |
by Corion (Patriarch) on Mar 28, 2013 at 12:55 UTC | |
by soonix (Chancellor) on Mar 29, 2013 at 19:49 UTC | |
by Bindo (Acolyte) on Apr 05, 2013 at 11:51 UTC | |
by soonix (Chancellor) on Apr 06, 2013 at 07:08 UTC | |
by Bindo (Acolyte) on Apr 07, 2013 at 04:12 UTC |