From: Vianney Lecroart Date: 2007-10-25T23:36:22+09:00 Subject: read write integer in binary into a file Hello, I have some big files with lot of "unsigned int" (4 bytes) numbers and I want to read and write on these files. Currently, I found this to write: myfile << [mynum].pack("i") and to read: mynum = myfile.read(4).unpack("i").first I wonder if there's not something faster/simpler to do that without the need to convert the number into an array into a string to finally serialize it. Thank you. -- Posted via http://www.ruby-forum.com/.