How to check endianess using ruby?

Hi,

What’s the right way to check the endianess(big/little endian) of the
machine
on which the ruby code run?

Thanks
Jan

Hi,

2008/12/19 Xie H. [email protected]:

Hi,

What’s the right way to check the endianess(big/little endian) of the machine
on which the ruby code run?

[1].pack(‘S’)[0]==1 ? ‘little’ : ‘big’

Regards,
Park H.

Hi,

2008/12/19 Xie H. [email protected]:

Hi,

What’s the right way to check the endianess(big/little endian) of the machine
on which the ruby code run?

[1].pack(‘S’)[0]==1 ? ‘little’ : ‘big’

cool thanks :slight_smile: