From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 5 12:20:40 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11C541065674 for ; Sun, 5 Jul 2009 12:20:40 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id 584EC8FC15 for ; Sun, 5 Jul 2009 12:20:39 +0000 (UTC) (envelope-from christoph.mallon@gmx.de) Received: (qmail invoked by alias); 05 Jul 2009 11:53:56 -0000 Received: from p54A3BF85.dip.t-dialin.net (EHLO tron.homeunix.org) [84.163.191.133] by mail.gmx.net (mp003) with SMTP; 05 Jul 2009 13:53:56 +0200 X-Authenticated: #1673122 X-Provags-ID: V01U2FsdGVkX1/uL4VnQ7fuy18m/B0eAfHmPf7qX97ivycRlXnrTf 2jR4VRvEyU+pd+ Message-ID: <4A509454.3020805@gmx.de> Date: Sun, 05 Jul 2009 13:53:56 +0200 From: Christoph Mallon User-Agent: Thunderbird 2.0.0.22 (X11/20090628) MIME-Version: 1.0 To: Alexander Best References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.71 Cc: freebsd-hackers@FreeBSD.org Subject: Re: carriage return with stdout and stderr X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 12:20:40 -0000 Alexander Best schrieb: > i'm running something similar to this pseudo-code in an app of mine: > > for (i=0 ....) > fprintf(stdout,"TEXT %d\r", int); > > what's really strange is that if i print to stdout the output isn't very > clean. the cursor jumps randomly within the output (being 1 line). if i print > to stderr however the output looks really nice. the cursor says right at the > front of the output all the time. just like in burncd e.g. > > what's causing this? because i'd rather print to stdout. stdout is buffered, stderr is not. Try fflush(). Christoph