How to check endianess using ruby?


#1

Hi,

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

Thanks
Jan


#2

Hi,

2008/12/19 Xie H. removed_email_address@domain.invalid:

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.


#3

Hi,

2008/12/19 Xie H. removed_email_address@domain.invalid:

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: