Path: utzoo!attcan!ncrcan!ziebmef!stephen From: stephen@ziebmef.uucp (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: using files in C on the IBM PC Summary: The Raw and the Cooked (with apologies to FYC) Message-ID: <1989May11.203209.9152@ziebmef.uucp> Date: 12 May 89 00:32:07 GMT References: <110@sol.bucknell.edu> Reply-To: stephen@ziebmef.UUCP (Stephen M. Dunn) Organization: Ziebmef Public Access Unix, Toronto, Ontario Lines: 15 Okay, most or all of the common C compilers for DOS operate in "cooked" mode by default on file accesses. This means that they treat ^Z (otherwise known as EOF) as the end-of-file marker, and they will play around with CRs and LFs. There is another mode of file access known as "raw" mode to DOS people and "binary" mode to C people. Instead of saying R or W as your file access mode, say RB or WB instead and DOS will stop playing with your file. You can then read or write whatever character codes your heart desires without fear of intervention from DOS. -- ------------------------------------------------------------------------------- ! Stephen M. Dunn stephen@ziebmef.UUCP ! DISCLAIMER: Who'd ever ! ! Take off to the Great White North eh, ya hosehead ! claim such dumb ideas? ! -------------------------------------------------------------------------------