On Thu, Jan 20, 2011 at 05:22:28PM +0000, Matthew Booth wrote:
Apart from being a good idea, this works round an apparent bug in either Term::ProgressBar or Term::ReadKey which seems to result in an attempt to write an exceptionally long progress bar.
Fixes RHBZ#671083
ACK. I'm a bit surprised that the progress bar is sent to STDERR by default (the default in Term::ProgressBar). For reference, similar code is used in guestfish except we check if stdin is a tty not stderr, and we output to stdout: http://git.annexia.org/?p=libguestfs.git;a=blob;f=fish/fish.c;h=10f645f5ddea... http://git.annexia.org/?p=libguestfs.git;a=blob;f=fish/progress.c;hb=HEAD Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org