Subject: Re: FILE I/O: fread() fails for GCC(Cygnus & DJ's) and TC++
From: [email-masked] (William Greathouse)

26 Apr 1997 10:46:25 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
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 <[email-masked]>
Original-Cc: [email-masked]
X-Priority: 3 (Normal)
Original-Sender: [email-masked]

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                | [email-masked]  Email
SMV America, Engineering          | [email-masked]        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:[email-masked]

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
"[email-masked]" with one line of text: "help".