From: aho450s AT nic DOT smsu DOT edu (Tony O'Bryan) Newsgroups: comp.os.msdos.djgpp Subject: Re: C-style FILE IO problems.. Date: Mon, 23 Dec 1996 21:18:54 GMT Organization: Southwest Missouri State University Lines: 20 Message-ID: <32bd4607.11854444@ursa.smsu.edu> References: <59enik$foo AT news DOT luth DOT se> <32BB5A76 DOT 27EC1FC AT alcyone DOT com> <59ggmj$3l AT news DOT luth DOT se> NNTP-Posting-Host: forseti.i31.smsu.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On 21 Dec 1996 11:12:19 GMT, roland DOT nilsson AT communique DOT se (Roland Nilsson) wrote: >Yes, I'm parsing binary files. I believe C FILE i/o is always in raw >mode. The only fopen() flags available are those relating to i/o >direction and overwrite, according to my djgpp function list. >I usually fopen() with "r". In MS-DOS, you have the option of using binary or text files. Which is the default is compiler dependent, so you should always specify which mode you want to use. fopen(name,"rb") will open in binary read mode fopen(name,"wb") will open in binary write mode fopen(name,"r+b") will open in binary read/write mode (if the file already exists) fopen(name,"w+b") will open in binary read/write mode (and overwrite an existing file)