From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 5890 invoked from network); 23 Nov 1999 18:46:34 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 23 Nov 1999 18:46:34 -0000 Received: from despam.spin.it (despam.spin.it [147.123.1.123]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id NAA26295 for ; Tue, 23 Nov 1999 13:46:32 -0500 Received: from mail.spin.it (plus.spin.it [147.123.1.12]) by despam.spin.it (Postfix/beta-19990601/Spin-ext-16nov1999) with ESMTP id 678C43C00D for ; Tue, 23 Nov 1999 19:46:19 +0100 (CET) Received: (from furio@localhost) by mail.spin.it (8.9.1/8.9.1/spin-int-nov1999) id TAA18435 for axp-list@redhat.com; Tue, 23 Nov 1999 19:46:19 +0100 Date: Tue, 23 Nov 1999 19:46:19 +0100 From: furio ercolessi To: axp-list@redhat.com Subject: Re: binary data files Message-ID: <19991123194619.A18183@spin.it> References: <199911230206.RAA10766@ruff.gi.alaska.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <199911230206.RAA10766@ruff.gi.alaska.edu>; from David Covey on Mon, Nov 22, 1999 at 05:06:51PM -0900 On Mon, Nov 22, 1999 at 05:06:51PM -0900, David Covey wrote: > Hi all, > I've been using Linux/Alpha for a while now and slowly working on > a problem I have with binary data files. I *think* I've figured it out > and have a kludge but I'd like to know if someone has come up with a > better explanation and/or solution. [...] > I've written a small C utility that reads a data file and word-swaps > the count, and optionally byte-swaps the data. I'd be happy to make it > available if it would help anyone else. > Please let me know if this is a previously solved problem, if I've > managed to re-invent the wheel, whatever... The Digital/Compaq Fortran compiler (are you talking about Fortran unformatted files, aren't you..?) has a switch to read/write big endian files rather than little endian. It works very well when exchanging files with AIX, HP-UX, Irix and Solaris. I suppose that you can enable the same switch on a file basis by putting some parameter in OPEN , and therefore writing a conversion program should be trivial under Tru64 Unix. I am not sure that a Compaq Fortran unformatted file is entirely compatible with a g77 unformatted file; but I would guess it is. furio ercolessi