From: rosenth@foto.chemie.unibas.ch (Lukas Rosenthaler)
Subject: Re: Endian problems...
Date: 1995/11/13 [thread overview]
Message-ID: <1995Nov13.114607.45664@yogi.urz.unibas.ch> (raw)
In-Reply-To: 47qk6j$7uj@news.duke.edu
gallatin@renoir.isds.duke.edu (Andrew Gallatin) writes:
>In article <47me7b$9an@taco.cc.ncsu.edu>, <decroix@brunt.meas.ncsu.edu> wrote:
>>
>>I want to *read* a IEEE floating point file and *write* a dec-native unformatted
>Can't you just write the file w/the wrong byte ordering & then run the
>result through 'dd conv=swap' to get a file w/the proper byte
>ordering?
>From the dd(1) man page:
>...
> conv=specification[,specification ...]
> Specifies one or more of the following conversions:
>..
> swab
> Swaps every pair of bytes.
>...
>We've done this to convert raw files created on a sparc for use w/our
>alphas.
Then You have been lucky - under normal circumstances this will not work.
That's because swapping of a 4 byte value (int) and of a 2 byte value (short)
is different. If You have binary files with mixed data, let's say
doubles, floats, ints, shorts and strings, then every item has to be swapped
appropriately!
Lukas Rosenthaler
next prev parent reply other threads:[~1995-11-13 5:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1995-11-07 5:00 Endian problems decroix
1995-11-08 5:00 ` Andrew Gallatin
1995-11-13 5:00 ` Lukas Rosenthaler [this message]
1995-11-13 5:00 ` Andrew Gallatin
1995-11-09 5:00 ` Steve Lionel
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox