From: Wes Gamble Date: 2006-03-22T07:28:56+09:00 Subject: Newbie: How do I get hex formatted bytes from a file? 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/.