This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: fread help!
- To: gpark at email dot arizona dot edu
- Subject: Re: fread help!
- From: ejfried at california dot sandia dot gov (friedman_hill ernest j)
- Date: Thu, 9 Aug 2001 11:51:35 -0700 (PDT)
- CC: cygwin at cygwin dot com
Well, here's a guess: the binary file was created on a SPARC Solaris
machine, and you're reading it on a Wintel machine. SPARC processors
are "big-endian" and Intel processors are "little-endian." If that's
the case, then you need to byte-swap the values as you read them
in. See, for instance, the cookbook at
http://astronomy.swin.edu.au/pbourke/dataformats/pcbinary.html .
I think GI-HYEON PARK wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi,
>
> I am trying to read binary file in WIN ME and it does not read data
> correctly.
> I tried the same code in solaris and it works fine..
>
> Does anybody know why C program in WIN ME reads data wrong?
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 ejfried@ca.sandia.gov
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/