From: Minero Aoki Date: 2003-05-19T07:28:20+09:00 Subject: Re: NET::POPMail: Any progress information for pop()? Hi, In mail "NET::POPMail: Any progress information for pop()?" "Josef 'Jupp' Schugt" wrote: > Saluton! > > Is it possible to have any progress information when using > Net::POPMail's instance method pop? > > If a message of 500 KiB is transferred via a modem connection (which > means a download of about two minutes) it is no fun not to have any > information about the dowload. You can use iterator style #pop. # Example: CUI base progress bar Net::POP.start(host, 110, user, pass) {|pop| pop.each_mail do |msg| $stderr.print 'reading a message: ' read = 0 msg.pop do |chunk| read += chunk.size if (read * 100 / msg.size) >= 10 $stderr.print '.' read = 0 end end $stderr.puts # msg.delete end } Result: % ruby poptest.rb reading a message: ......... % Regards, Minero Aoki