Date: Wed, 9 Dec 1998 19:31:50 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: HANRIGOU 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.