From: "Brian Schröder" Date: 2005-11-28T23:22:21+09:00 Subject: Re: Pack an arbitrary length string of bytes? On 28/11/05, speechexpert wrote: > I need to write and then read a number of bytes to and from a file... > It seems the pack method will do it, but > does anyone know how to invoke it for a string of bytes? > Thanks in advance, > John B > > > string = "some junk" File.open('/tmp/junk', 'wb') do | file | file.print(string) end read = File.read('/tmp/junk') p(string == read) -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/