From: wgreathouse AT smva DOT com (William Greathouse) Subject: Re: FILE I/O: fread() fails for GCC(Cygnus & DJ's) and TC++ 26 Apr 1997 10:46:25 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <3362107E.321B940D.cygnus.gnu-win32@smva.com> References: <0009386C DOT 1950 AT ccmail DOT irs DOT gov> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------289080514228D79AE955947A" >Received: from iago by mailserv.smva.com (AIX 3.2/UCB 5.64/4.03) id AA30654; Sat, 26 Apr 1997 10: 26:15 -0400 X-Mailer: Mozilla 4.0b3 [en] (Win95; I) Original-To: Rich Kucera Original-Cc: gnu-win32 AT cygnus DOT com X-Priority: 3 (Normal) Original-Sender: owner-gnu-win32 AT cygnus DOT com This is a multi-part message in MIME format. --------------289080514228D79AE955947A Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Rich Kucera wrote: > On Linux & MPRAS, the sample program listed below manages to > read through all thirty POINT structures with no problems. > > The program won't port however, because it appears that > any DOS-based (FAT?) compiler (Cygnus GCC & DJ's GCC and Turbo > C), > creates a binary that quits halfway through the data(15 points > read). > > I'm probably missing something about file I/O, or it > could be some low-level file I/O problem. I don't know, help. And that is your answer... On a DOS system there is a distinction between "text" and "binary" mode files that is not evident in the *NIX world. You need to change your fopen mode from "r" to "rb" (for binary) and your program/data will work together correctly on both DOS and *NIX systems. Bill -- William Greathouse | wgreathouse AT smva DOT com Email SMV America, Engineering | wgg AT netcom DOT com Email 8380 Darrow Road | (216) 425-1340 x4006 Voice Twinsburg, OH 44087 | (216) 405-7684 FAX --------------289080514228D79AE955947A Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for William Greathouse Content-Disposition: attachment; filename="vcard.vcf" begin:vcard fn:William Greathouse n:Greathouse;William org:SMV America Engineering adr:8380 Darrow Road;;;Twinsburg;OH;44087; email;internet:wgreathouse AT smva DOT com title:Senior Engineer tel;work:(216) 425-1340 x4006 tel;fax:(216) 405-7684 x-mozilla-cpt:;0 x-mozilla-html:FALSE end:vcard --------------289080514228D79AE955947A-- - 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".