[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: printversion could be more translation-friendly



On Tue, May 28, 2002 at 05:36:18PM +0200, Santiago Vila wrote:
> Wichert Akkerman wrote:
> > dpkg is extremely careful about such things. If you think you know a
> > place where it doesn't properly check if output is done correctly let us
> > know and we'll investigate.
> 
> In the same main/main.c file, the output of dpkg --help is done by a
> fprintf which is nearly identical to the one I proposed for dpkg --version,
> and there is no fflush after it.
> 
> [ In *both* cases the program terminates just after showing the message,
>   and also the string is \n-terminated ].

My understanding, which may well be wrong, is that fprintf(...,stdout)
should have the same effect as printf(...). viz. whether or not the
stream gets flushed depends upon its settings.  For typical,
interactive use, processes end with with their stdout stream
line-buffered (by libc, I assume) so the \n should force a flush.  I
think that if you run a program in a pipeline or in someother way,
stdout becomes fully buffered, only flushing when asked or when the
buffer gets full.  And I think stderr is always unbuffered.

But this is all just the impression I've got from my programming
experience... it could all be wrong...

Jules


-- 
To UNSUBSCRIBE, email to debian-dpkg-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: