Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com From: ejfried AT california DOT sandia DOT gov (friedman_hill ernest j) Message-Id: <200108091851.LAA30345@california.sandia.gov> Subject: Re: fread help! In-Reply-To: from GI-HYEON PARK at "Aug 9, 2001 11:42:31 am" To: gpark AT email DOT arizona DOT edu Date: Thu, 9 Aug 2001 11:51:35 -0700 (PDT) CC: cygwin AT cygwin DOT com X-Mailer: ELM [version 2.4ME+ PL65 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 AT ca DOT sandia DOT 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/