[ale] Re: binary data format (fwd)

Marc Torres marct at mindpsring.com
Wed Mar 6 22:54:01 EST 1996


> Subject:       [ale] Re: binary data format (fwd)
> Date:          Wed, 6 Mar 1996 21:21:31 -0500 (EST)

[..edited..]
> 
> }> >What is the difference between the binary formats on a Sun Sparc
> }> >and a Linux system?  I have a bunch of binary data that was written
> }> >on a Sparc, but I can't get anything but gibberish when I try
> }> >to read it on my Linux system.  How can I convert the data to
> }> >be read by the Linux system?
> }> 
> }> It may be the representation of the actual data, referred to as little
> }> endian vs. big endian.  Basically every other byte is swapped.  The
> }> easiest way to check it out is to do an octal dump using 'od' on the
> }> file.  The machine will represent the data either byte0, byte1 or byte1, byte0
> }> order.   You could write a small C program to swap the bytes if you are
> }> familiar with bit twiddling.  There are probably tools out there to do
> }> it, but I've never seen them.
[..edited..]

If it is a representation problem and memory serves ;-) GNU tar,
or cpio (dd?) have options for reversing byte order when extracting.
Check the man page(s) on that one.

Actually I may be way off here, but I thought GNU tar stored data 
in XDR format which was supposed to 'automagicly' handle this kind
of problem?  (Not a C programmer, so this could just be all from
my imagination...)

Hope that helps.
Marc Torres






More information about the Ale mailing list