I want to do:

File.open(path_to_file, "r") do |f|
        magic_number = f.read(8)
        $stderr.print "Magic number is: #{magic_number}\n"
      end

but I want to print the bytes as HEX values - how do I do that?

Thanks,
Wes

-- 
Posted via http://www.ruby-forum.com/.