From owner-freebsd-questions Sat Dec 2 5:41:39 2000 Delivered-To: freebsd-questions@freebsd.org Received: from merganser.its.uu.se (merganser.its.uu.se [130.238.6.236]) by hub.freebsd.org (Postfix) with ESMTP id 0015137B400 for ; Sat, 2 Dec 2000 05:41:35 -0800 (PST) Received: from regulus.student.UU.SE ([130.238.5.2]:49742 "HELO ertr1013.student.uu.se") by merganser.its.uu.se with SMTP id ; Sat, 2 Dec 2000 14:41:27 +0100 Received: (qmail 557 invoked by uid 1001); 2 Dec 2000 13:41:05 -0000 Date: Sat, 2 Dec 2000 14:41:05 +0100 From: Erik Trulsson To: Sue Blake Cc: freebsd-questions@freebsd.org Subject: Re: "unbuffered" ? Message-ID: <20001202144104.A535@student.uu.se> Mail-Followup-To: Sue Blake , freebsd-questions@freebsd.org References: <20001202224250.L377@welearn.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20001202224250.L377@welearn.com.au>; from sue@welearn.com.au on Sat, Dec 02, 2000 at 10:42:52PM +1100 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Dec 02, 2000 at 10:42:52PM +1100, Sue Blake wrote: > I've seen this sort of thing in several man pages: > > cat(1) > -u The -u option guarantees that the output is unbuffered. > tr(1) > -u The -u option guarantees that any output is unbuffered. > tee(1) > ... The output is unbuffered. > > > What does unbuffered mean, and how is it useful to know or manipulate that? > Unbuffered means it is not buffered. :-) Alright, so what is buffered output I hear you ask. When output is buffered it means the program saves up several bytes before writing all of them. The reason for this is that it is much more efficient to write 100 bytes at once than doing 100 calls each of which only writes one byte. Sometimes, especially when displaying text on the screen, you want programs to write stuff immediately instead of waiting for more output. When writing to a normal disk file on the other hand you usually want buffered output. Basically unbuffered output gives better interactive performance but has higher overhead. -- Erik Trulsson ertr1013@student.uu.se To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message