From: w wg Date: 2007-01-16T00:10:14+09:00 Subject: Re: unpack 4 bytes to a signed integer But the "i" and "I" modifer don't care bytes order. I'm reading data from network using IO#sysread, I need receive integer , not unsigned integer. Thank you for your reply. 2007/1/15, Mike Stok : > > On 15-Jan-07, at 8:29 AM, w wg wrote: > > > Hi > > I' m using unpack to convert 4 bytes to local integer, but ruby just > > supply the "N" modifer which means unsigned long integer. > > > > My questions is : > > How to unpack 4 bytes to a signed integer ? > > > There are "i" and "I" for signed and unsigned integer respectively, > which deals in the local size of integer. > > Hope this helps, > > Mike > > -- > > Mike Stok > http://www.stok.ca/~mike/ > > The "`Stok' disclaimers" apply. > > > > > > -- -- WenGe Wang