delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/09/11:25:22

Message-ID: <366EA3ED.307E773@CGSTE.MQ>
Date: Wed, 09 Dec 1998 12:23:09 -0400
From: HANRIGOU <HANRIGOU AT cgste DOT mq>
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>
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.

- Raw text -


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