From: jeffdbREMOVETHIS AT netzone DOT com (Mikey) Subject: Re: Reading a ^Z 6 Sep 1997 16:17:11 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <340f7786.86893945.cygnus.gnu-win32@smtp.netzone.com> References: <07551A47EAD6D01186430060B025C6F40A6CA8 AT ntserver DOT kiwiplan2 DOT co DOT nz> Reply-To: jeffdbREMOVETHIS AT netzone DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Original-To: Ian Collins , gnu-win32 AT cygnus DOT com In-Reply-To: <07551A47EAD6D01186430060B025C6F40A6CA8@ntserver.kiwiplan2.co.nz> X-Mailer: Forte Agent 1.01/32.397 Original-Sender: owner-gnu-win32 AT cygnus DOT com Remount your filesystems with -b, the only thing that gets opened in text mode (recognizes ^Z and expects \r\n) after you do that are pipes. Geoff did the default install get changed for B19 ;^)? Please Please Please!!!! you will need to reinstall your headers/sources/shellscripts etc. or manually convert them to \n only. don't forget the config files in ~/ and /etc, .bashrc and .bash_history passwd group etc... On Wed, 3 Sep 1997 16:37:54 +1200, you wrote: >Please help someone! > >I am sure this has come up before (probably before I joined). >I am reading a binary file. The file is fopened with O_RDONLY. >When doing the read, I am using, > >n = fread((void *) buffer, (size_t) sizeof(char), (size_t) >numrecs*reclen, ifd); > >where numrecs and reclen are the number of records in the file each of >length reclen. > >If there is a control-Z (^Z) in the file, the fread will read up to the >^Z and the rest of the buffer is filled with NULLS. >Now I know, in the distant past, DOS files were terminated by a ^Z, but >surely there is a workaround to this. >I am using b18 with Sergeys latest cygwin.dll. >- >For help on using this list (especially unsubscribing), send a message to >"gnu-win32-request AT cygnus DOT com" with one line of text: "help". > (jeffdbREMOVETHIS AT netzone DOT com) delete REMOVETHIS from the above to reply Mikey - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".