delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/09/12:31:34

Date: Wed, 9 Dec 1998 19:31:50 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: HANRIGOU <HANRIGOU AT cgste DOT mq>
cc: djgpp AT delorie DOT com
Subject: Re: read/write in binary mode: fopen/open behaviour
In-Reply-To: <366EA3ED.307E773@CGSTE.MQ>
Message-ID: <Pine.SUN.3.91.981209192716.11864C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Wed, 9 Dec 1998, HANRIGOU wrote:

> > However, if you open a file with "rb" it does open the underlying
> > descriptor with O_BINARY, so it should work as you expect.
> > Are you using 2.01 or 2.02?
> That was more that I was asking for. But it do not seem to work on my
> computer. I am using 2.01 under W95. Maybe that's the clue. Should I upgrade to
> 2.02?

I didn't see anything different between 2.01 and 2.02 in this context.  
Both versions call `open' with O_BINARY when `fopen' is called with "rb" 
or "wb".

> Anyway, I think I'll keep the explicit "setmode(fd, O_BINARY)" call
> in my final code so as letting it run and compile under 2.01. I do
> not see any major drawback doing so. Are there any?

Yes, there is a drawback: there might be a bug lurking somewhere which we
sweep under the carpet instead of solving.  And since v2.02 is just 
released, if we don't solve it now, God knows when it will be solved...

So please consider digging a bit deeper, so we at least understand why 
don't things work in that program.

Perhaps if you describe in a bit more detail how exactly the program 
fails, somebody might have a clue as to what goes wrong.

- Raw text -


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