knils_r00t has asked for the wisdom of the Perl Monks concerning the following question:

Any help will be greatly appreciated

|=============> | Got 422452 bytes of 689368 (61.28%)

#ftp script use Net::FTP; print "Starting the FTP service . . . .\n"; print "Enter the Hostname/ip : "; chomp($host=<STDIN>); $ftp = Net::FTP->new("$host", Timeout => 30) or die "Could not connect.\n"; print "Enter the User :"; chomp($user=<STDIN>); print "Enter the Password :"; chomp($pass=<STDIN>); $ftp->login("$user", "$pass") or die "Could not log in.\n"; if(login) { print "Connected Successfully . . . .\n"; } #$ftp->cwd('/home/knils/Desktop') # or die "Can not change Directory"; while(1) { print "ftp> "; chomp($fn=<STDIN>); if ($fn eq "bye") { exit 0; } ($fn1,$fn2)= split / +/, $fn; $ftp->$fn1("$fn2") or print "Invalid Operation\n"; }
  • Comment on Add a graphical stream to ftp which tells how much data is downloaded
  • Download Code

Replies are listed 'Best First'.
Re: Add a graphical stream to ftp which tells how much data is downloaded
by Corion (Patriarch) on Apr 15, 2012 at 08:39 UTC

    Take a look at the ->hash method of Net::FTP. If you want to show a progress indicator, you will have to override that method to output something other than hash mark.

Re: Add a graphical stream to ftp which tells how much data is downloaded
by roboticus (Chancellor) on Apr 16, 2012 at 15:14 UTC

    knils_r00t:

    You might read THE dataconn CLASS section of Net::FTP: It shows method bytes_read() which you could possibly use to drive your graphical stream. (I've not done this, so take this with a grain of salt.)

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.