Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!netsys!jsheese!jeffery From: jeffery@jsheese.FIDONET.ORG (Jeff Sheese) Newsgroups: comp.sys.ibm.pc Subject: Re: using files in C on the IBM PC Message-ID: <69.246B7C0A@jsheese.FIDONET.ORG> Date: 13 May 89 00:46:17 GMT Organization: JStek Enterprises - Frederick, MD Lines: 25 References: <1989May11.203209.9152@ziebmef.uucp> In an article of <12 May 89 00:32:07 GMT>, stephen@ziebmef.uucp (Stephen M. Dunn) writes: > 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. Turbo C has a feof() function to determine the logical end of file, regardless of the ^Z. Using ^Z as an EOF mark is a layover from CP/M days for compatibility reasons. -- Jeff Sheese - via FidoNet node 1:109/116 UUCP: ...!netsys!jsheese!jeffery ARPA: jeffery@jsheese.FIDONET.ORG (I am sole owner. My opinions represent my company.) (Send all flames to null@jsheese.Fidonet.ORG)