RE: O_BINARY

Mark Maxham <[email protected]>
Newsgroups gmane.comp.lib.libwww
Message-ID <[email protected]>
Oops, I just realized that while I fixed the binary constants, I didn't
fix the text constants.

<- #define HT_FT_RDONLY	HT_FB_RDONLY
-> #define HT_FT_RDONLY	O_RDONLY

etc.


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Mark Maxham
Sent: Thursday, October 17, 2002 5:40 PM
To: [email protected]
Subject: O_BINARY



I discovered that my www-lib .exe file, built under Cygwin, was behaving
differently depending on whether it was launched from Cygwin or from a
DOS prompt.  I discovered that the discrepancy was because it was
opening the files as text, even though the naming of the constants
indicated that it was supposed to be opening in binary mode (I assume
that's what "FB" means, in contrast to "FT").

It appeared to be fixed via the following changes to HTLocal.h:

<- #define HT_FB_RDONLY	O_RDONLY
-> #define HT_FB_RDONLY	O_RDONLY|O_BINARY
   #define HT_FT_RDONLY	HT_FB_RDONLY
   
<- #define HT_FB_WRONLY	O_WRONLY|O_CREAT
-> #define HT_FB_WRONLY	O_WRONLY|O_CREAT|O_BINARY
   #define HT_FT_WRONLY	HT_FB_WRONLY
   
<- #define HT_FB_RDWR	O_RDWR
-> #define HT_FB_RDWR	O_RDWR|O_BINARY
   #define HT_FT_RDWR	HT_FB_RDWR
   
<- #define HT_FB_APPEND	O_APPEND
-> #define HT_FB_APPEND	O_APPEND|O_BINARY
   #define HT_FT_APPEND	HT_FB_APPEND

Thanks
Max
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.