On 11/16/06, Francis Cianfrocca <garbagecat10 / gmail.com> wrote: > On 11/15/06, Eric Hodel <drbrain / segment7.net> wrote: > > > > On Oct 24, 2006, at 4:40 PM, Tim Pease wrote: > > > > > Does ruby provide a global or a method call to determine the endianess > > > of the underlying platform? > > > > > > This is what I cooked up, but I'm wondering if there is a ruby way of > > > doing this. > > > > > > BIG_ENDIAN = [0xFF00].pack('S') == [0xFF00].pack('n') > > > > Beware, some versions of ruby shipped with OS X have a broken pack > > where the endianness is swapped. > Kinky. Is it a bug, or a hack intended to make PowerPCs look like Intel > chips? Bug. It was fixed in a later OS update, IIRC. -austin -- Austin Ziegler * halostatue / gmail.com * http://www.halostatue.ca/ * austin / halostatue.ca * http://www.halostatue.ca/feed/ * austin / zieglers.ca