From: Francis Cianfrocca Date: 2006-11-16T21:37:13+09:00 Subject: Re: Endianess of the underlying platform ------=_Part_5496_19348121.1163680631579 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/15/06, Eric Hodel 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? ------=_Part_5496_19348121.1163680631579--