Strange problem with structs Linux vs. Mac
jasynwiener at gmail.com
Sun Mar 16 19:22:54 CET 2008
Completely helped! Working as expected now.
Thanks. You really got me out of a bind!
On Mar 16, 10:23 am, "Martin Blume" <mbl... at 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
> >>> struct.unpack('<I', s)
> >>> struct.unpack('>I', s)
> See help(struct) for further information.
> This seems to imply that the Mac, although running now on Intel
> processors, is still big-endian.
More information about the Python-list