From: Gavin Kistner Date: 2005-05-24T21:19:13+09:00 Subject: Re: Endian packing errors. --Apple-Mail-1--956494231 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed 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 [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 --Apple-Mail-1--956494231--