From: jjenning@... (jared l. jennings) Date: 2001-07-10T08:27:43+09:00 Subject: [ruby-talk:17566] Re: writing arbitrary data to a socket On Tue, Jul 10, 2001 at 07:45:03AM +0900, Al Chou wrote: > Do I need to convert my data to a string of ASCII characters in order to write > this struct to a socket? Yes. I can actually somewhat help you with this one, unlike the previous question :) In order to send something with the 'socket' extension in ruby, it must first be a string. You can store your struct in an Array like this: my_all_thing = [a, b, c, d, e, f, g, data] where a-g are numbers and data is a String. Then you can use the pack method to pack it into a string: my_all_thing.pack("ICCcCILa") or so. (Characters to use in the string to pass to pack are, of course, listed in the documentation for Array#pack.) -- HELP! MY TYPEWRITER IS BROKEN! -- E. E. CUMMINGS