From: Brian Mitchell Date: 2005-05-24T22:40:15+09:00 Subject: Re: Endian packing errors. On 5/24/05, Gavin Kistner wrote: > On May 23, 2005, at 11:53 AM, Brian Mitchell wrote: > > I have a number I must convert to a network long. I have been using > > this thus far with success: > > > > [number].pack("N") > > > > for 65 it should return "\000\000\000A". It does so on my linux boxes, > > an iMac with 10.3 but on my Powerbook with 10.4 it returns the reverse > > "A\000\000\000". What is causing this. Did Apple mess up yet again > > with including ruby? Could someone duplicate this on tiger? > > Not reproducible by me. MacOS 10.4.1 on a 1GHz Powerbook > I this using the ruby that comes with 10.4, a custom build, or something else? > [Slim:~] gavinkis% ruby -v > ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0.0] > [Slim:~] gavinkis% cat pack.rb > p [65].pack("N") > [Slim:~] gavinkis% ruby pack.rb > "\000\000\000A" > [Slim:~] gavinkis% uname -a > Darwin Slim.local 8.1.0 Darwin Kernel Version 8.1.0: Tue May 10 > 18:16:08 PDT 2005; root:xnu-792.1.5.obj~4/RELEASE_PPC Power Macintosh > powerpc Thanks, Brian.