Mail Archives: djgpp/1998/03/08/07:24:14
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 -