From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31870 invoked by alias); 15 Aug 2003 19:34:32 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 31861 invoked from network); 15 Aug 2003 19:34:31 -0000 Received: from unknown (HELO perry.geo.berkeley.edu) (128.32.149.11) by sources.redhat.com with SMTP; 15 Aug 2003 19:34:31 -0000 Received: from seismo54.geo.berkeley.edu (seismo54.geo.berkeley.edu [128.32.149.157]) by perry.geo.berkeley.edu (8.12.9/8.12.9) with SMTP id h7FJYNLg024968 for ; Fri, 15 Aug 2003 12:34:24 -0700 (PDT) Message-Id: <200308151934.h7FJYNLg024968@perry.geo.berkeley.edu> Date: Fri, 15 Aug 2003 19:34:00 -0000 From: Mark Panning Reply-To: Mark Panning Subject: Reading big-endian binary data on a little-endian machine To: gcc-help@gcc.gnu.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Content-MD5: mU86g93PLn2omxBuT0rvKw== X-SW-Source: 2003-08/txt/msg00148.txt.bz2 I currently am in the process of trying to move some of my codes from a Big-Endian Solaris system to a little-endian PC cluster running Linux. I would however like to continue to use the binary data files I was using on the Big-Endian system. In ifc, a Fortran compiler, there is an environment variable F_UFMTENDIAN which can be set such that all READ operations automatically perform a big-to-little conversion and all WRITE operations perform the little-to-big covnersion. Is there something similar which I can do with gcc or with options in the read/write or fread/fwrite functions? Mark Panning