On Thu, 30 May 2024 at 18:37, Richard Henderson
<richard.hender...@linaro.org> wrote:
>
> On 5/30/24 05:51, Peter Maydell wrote:
> >> @@ -87,13 +87,13 @@ sub progress_update($)
> >>       my $barlen = int($proglen * $done / $progmax);
> >>       if ($barlen != $lastprog) {
> >>           $lastprog = $barlen;
> >> -        print "[" . "-" x $barlen . " " x ($proglen - $barlen) . "]\r";
> >> +        print STDOUT "[" . "-" x $barlen . " " x ($proglen - $barlen) . 
> >> "]\r";
> >>       }
> >>   }
> >>
> >>   sub progress_end()
> >>   {
> >> -    print "[" . "-" x $proglen . "]\n";
> >> +    print STDOUT "[" . "-" x $proglen . "]\n";
> >>       $| = 0;
> >>   }
> >
> > These are the progress-bar indicators -- shouldn't they go to STDERR,
> > not STDOUT, if we're going to be careful about where we send output?
>
> Why?  I would think that only errors would go do stderr...

Usually when programs have their stdout and stderr going to
different places it's because stderr is the terminal and
stdout is "wherever the 'normal output' of the program
should go". So progress bars and error messages go to stderr
because those are for the user reading the terminal, not
for whatever is consuming the normal output.

In the risugen case we always output to a named file,
so the distinction is less important.

thanks
-- PMM

Reply via email to