Date: Sun, 8 Mar 1998 14:22:43 +0200 (IST) From: Eli Zaretskii To: Nate Eldredge cc: viking AT caverock DOT net DOT nz, djgpp AT delorie DOT com Subject: Re: Pipes and how to seek In-Reply-To: <199803071658.IAA27573@adit.ap.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sat, 7 Mar 1998, Nate Eldredge wrote: > setmode(fileno(stdin), O_BINARY); A better way is to say this: if (!isatty(fileno(stdin))) setmode(fileno(stdin), O_BINARY); IMHO, you should avoid setting the console to binary mode at all costs, since this have some nasty side-effects (e.g., you cannot interrupt a runaway program with Ctrl-C). In my experience, it is never really needed anyway: if binary garbage is being sent to the screen, who cares if it gets truncated?