Path: utzoo!attcan!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.sys.ibm.pc Subject: Re: more details on microsoft c file io bug Message-ID: <11296@steinmetz.ge.com> Date: 20 Jun 88 15:13:01 GMT References: <1327@spdcc.COM> <232@wjh12.harvard.edu> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Distribution: na Organization: General Electric CRD, Schenectady, NY Lines: 24 This one is not a bug, it's a feature (really). The reason the b for binary qualifier was added to fopen by X3J11 is that a number of operating systems write a file format for text which contains something other than the data passed to fwrite. Microsoft could have read the files litterally, leveing the user to filter out the CR's and know that ^Z meant EOF, but they did it for you, and gave you the binary option so you could read raw data as written. It soulds to me as if the wrong method of reading the data was chosen, followed by a bug report because it didn't do what was expected. I've done that myself, although it's less embarassing when I do it directly to the vendor rather than worldwide. The largest need for this is in the VAX/VMS area, where there are (I believe) 11 file formats, only one of which contains the data written by the user, all the data, and nothing else. You can easily identify it because it's called something like "LF delimited binary stream" format. Should you use any other, you hope your C runtime does the translation into text for you, so you don't have to do it yourself. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me