[ale] Re: binary data format (fwd)

Unix Guru Dude geof at denali.is.net
Wed Mar 6 21:21:31 EST 1996


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,
}which might come in handy.  Otherwise I do it myself.  What you
}mentioned raises a question:  In older versions of Unix (e.g. SunOS 4.1), 
}od let you define the number of bytes per line with -w, but the od
}on Solaris 2.0 doesn't support this switch.  Any suggestions?
}
}Alan
}
}----------------------------------------------------------------------
}Alan Folz                          |    Turbulence Research Lab
}Dept. of Mechanical Engineering    |    phone:   (301) 405-5330
}University of Maryland             |    fax:     (301) 314-9477
}College Park, MD 20742             |    e-mail:  alfolz at eng.umd.edu
}
}


-- 
Opinions expressed by me are mine, all mine, only mine.....

Until later:
Geoffrey Myers   geof at denali.is.net   eiger at ichange.com   gamyers at attmail.com
	http://www.ticllc.net/~geof






More information about the Ale mailing list