On Wed, 1 Feb 2006, Mark Volkmann wrote:

> How can I write non-string data using the IO class?
> In particular, I'd like to write an integer across a socket connection.
> All the methods I see in IO for writing either only write strings or
> only write the to_s version of an object, which is of course a string.

see String#unpack and Array#pack.

you probably want something like

   socket.write [42].pack("N")

cheers.

-a

-- 
happiness is not something ready-made.  it comes from your own actions.
- h.h. the 14th dali lama