[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#6038) Write slapadd progress meter to stdout



Hallvard B Furuseth wrote:
> hyc@symas.com writes:
>> Just redirect stdin, and the meter will automatically turn itself off.
>
> It was stderr, not stdin - which after all can be the ldif.
> Stdout is better.
>
No, you misunderstand.

Redirecting stderr (or stdout) merely sends the progress info to that 
destination. Piping input on stdin will turn it off, so there's no progress 
info to redirect.

Writing progress to stderr is the correct thing to do, because it's transient 
info that isn't meant to be saved. Checking whether stdout is redirected or 
not is fine, but writing progress info to stdout is not.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/