delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/08/07:24:14

Date: Sun, 8 Mar 1998 14:22:43 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nate Eldredge <eldredge AT ap DOT net>
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: <Pine.SUN.3.91.980308142219.22686d-100000@is>
MIME-Version: 1.0

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?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019