jasonwiener
3/16/2008 6:23:00 PM
Completely helped! Working as expected now.
Thanks. You really got me out of a bind!
J.
On Mar 16, 10:23 am, "Martin Blume" <mbl...@freesurf.ch> wrote:
> "jasonwiener" schrieb
>
> > I am having a VERY odd problem with unpacking right now.
> > I'm reading data from a binary file and then using a very
> > simple struct.unpack to get a long. Works fine on my MacBook,
> > but when I push it to a Linux box,it acts differently and
> > ends up pewking.
> > [...]
>
> > the data looks to be the same, but the unpacking seems to
> > treat it differently.
>
> Probably little-endian vs. big-endian issue:
>
> >>> s
> '\x1e\xc6\xf3\xb4'
> >>> struct.unpack('<I', s)
> (3035874846L,)
> >>> struct.unpack('>I', s)
>
> (516354996L,)
>
> See help(struct) for further information.
>
> This seems to imply that the Mac, although running now on Intel
> processors, is still big-endian.
>
> HTH
> Martin