ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/29/14:17:22

Date: Thu, 29 Jun 1995 13:54:31 -0400 (EDT)
From: David Steiner Nieves <dsn AT chem DOT duke DOT edu>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: read()?

> 	1) Under 1.12m4, you must close() handle 0 and open the console again
> in O_BINARY mode.  Then your code will work as you'd expect.  See the example
> code below for details.
> 
> 	2) Under v2.0beta1, you should call setmode(0, O_BINARY) before entering
> the loop.  This forces the reads from standard input to work in raw mode, without
> which the read() call waits for a CR before it returns (that's a DOS (mis)feature).
> Currently, v2.0 library has a bug (IMHO) whereas open("con", O_BINARY) doesn't set
> the handle to raw mode, so the solution in 1) above won't work unless you also
> explicitly call setmode() after open().  I reported this to v2.0 bug-tracking
> system, so it will most probably be fixed in the final v2.0 release.

A while ago I ran into a situation (I think it was with Borland, but it 
might exist in djgpp) where I wanted to treat cin and cout in "raw" 
mode.  Is there a way to do this that is analogous to what you wrote above?

Thanks in advance,

David
http://www.duke.edu/~dsn

- Raw text -


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