Message-ID: <366EA3ED.307E773@CGSTE.MQ> Date: Wed, 09 Dec 1998 12:23:09 -0400 From: HANRIGOU X-Mailer: Mozilla 4.06 [en] (Win95; I) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: read/write in binary mode: fopen/open behaviour References: <366D541F DOT 7E73636E AT CGSTE DOT MQ> <199812081642 DOT LAA05459 AT envy DOT delorie DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Hi DJ, DJ Delorie wrote: > FILE* streams don't use read() or write(), they use _read() and > _write() directly, and manage the text/binary conversions themselves. > Why? So they can do fseek() and ftell() properly. Thanks a lot for your (quick) help. I suspected that, but it was no so clear and precise :-) > 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? 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? Thanks a lot for your help. Best regards, Philippe -- Sorry for my bad english. Spelling corrections are appreciated.