www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/07/21/11:10:43

Date: Fri, 21 Jul 95 10:03:20 EST
From: dpsm AT lubrizol DOT com
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Text/Binary mode of stdin,stdout,stderr

I'm just starting to play with djgpp v2, and I have a question.  How do you 
set binary or text mode of the standard input and output?

From emacs.c:

#ifdef MSDOS
  /* We do all file input/output as binary files.  When we need to translate
     newlines, we do that manually.  */
  _fmode = O_BINARY;
  (stdin)->_flag &= ~_IOTEXT;
  (stdout)->_flag &= ~_IOTEXT;
  (stderr)->_flag &= ~_IOTEXT;
#endif /* MSDOS */

The #define _IOTEXT is not in stdio.h (it was in previous versions).  Is it 
the same as pre v2?  Is there a "portable" or "standard" way to do this in 
ANS C?

I remember twiddling bits like this with Borland, but I also seem to 
remember a setmode() call, but if you knew my memory....

Thanks,
        Dale


- Raw text -


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