From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3f66cb31a9300a74 X-Google-Attributes: gidfee84,public From: rosenth@foto.chemie.unibas.ch (Lukas Rosenthaler) Subject: Re: Endian problems... Date: 1995/11/13 Message-ID: <1995Nov13.114607.45664@yogi.urz.unibas.ch>#1/1 X-Deja-AN: 119289332 references: <47me7b$9an@taco.cc.ncsu.edu> <47qk6j$7uj@news.duke.edu> newsgroups: comp.unix.osf.osf1 gallatin@renoir.isds.duke.edu (Andrew Gallatin) writes: >In article <47me7b$9an@taco.cc.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