From: frank hi Date: 2011-09-10T09:57:27+09:00 Subject: how to write data in binary to a file? Hi, I want to write the data into a file in binary mode. The file is opened in binary mode by ofile=File.open("filename",'wb'). However, when I write the data using ofile.write(1), ruby will write the ascii code 31 to the file. I want it to write one byte number withe value 1. How can I do it? I have been googling a lot and could not find the answer. Thanks Frank -- Posted via http://www.ruby-forum.com/.