[Tfug] Byte Order

Bexley Hall bexley401 at yahoo.com
Sat Nov 18 11:43:15 MST 2006


Hi, Jim,

> I know I can look this up somewhere, but SOMEONE out
> there probably knows
> this off the top - is there is difference in byte
> ordering for short
> integers between a Solaris/Sun system and a Linux/PC
> system?  I'm trying to

Intel is Little Endian and SPARC is Big Endian.

> read files taken from 9-track tapes built on an old
> PR1ME minicomputer
> using software written to work on a Sun/Solaris
> system and it ain't working
> on Linux/PC.  Looks like a byte order problem.

Be sure what you are reading is, indeed, shorts.
Note that "text" stored on tapes is often stored
in EBCDIC so it *almost* looks right -- but isn;t!  :<

Easiest approach is to read everything between
file marks as a long unsigned char[] and store it
as a file (even a 3600ft 6250 tape isn't more than
a few hundred MB).  Then, you can examine the file
and reprocess it's contents to something that makes
sense "at disk speed".  (chances are you don't
want to be rereading an old tape many times if
the data is important to you!)

HTH,
--don


 
____________________________________________________________________________________
Sponsored Link

Mortgage rates near 39yr lows. 
$420k for $1,399/mo. Calculate new payment! 
www.LowerMyBills.com/lre




More information about the tfug mailing list