[ale] Re: binary data format (fwd)

Alfred Grahame Leach aleach at cc.gatech.edu
Wed Mar 6 22:57:44 EST 1996


On Wed, 6 Mar 1996, Unix Guru Dude wrote:

> Thought I'd look to the ALE for some help for this guy.  If anyone knows of
> a tool that will assist him with converting this Sun data to Linux, please
> either let me know of email him at the address below.  Actually, if you are
> aware of such a tool, I'd like to know too, so if you respond to him, CC:
> me please.
> 
> }> >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.
> }
> }Thanks for the comments.  One tool that's been suggested is htonl,

I'm not sure if I know anything too useful, but I think htonl is along 
the same lines as what I'm about to suggest.  The idea of using htonl is 
to write a C program that uses this function to convert data.  I wonder 
if simply UUENCODEing the data on the sparc, and then UUDECODEing it on 
the linux box will work - same idea, but no programming involved.

Good luck...

- Al Leach (aleach at cc.gatech.edu)






More information about the Ale mailing list