W3C home > Mailing lists > Public > www-lib@w3.org > October to December 2002

O_BINARY

From: Mark Maxham <max@ispiri.com>
Date: Thu, 17 Oct 2002 17:40:29 -0700
To: www-lib@w3.org
Message-id: <001901c2763e$f58db530$030b010a@ISPIRI.COM>

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
Received on Thursday, 17 October 2002 20:42:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:42 GMT