From: John Joyce Date: 2007-06-16T01:48:24+09:00 Subject: Re: wite an integer to file as binary This one is always a stumper. use the method to_s(2) 5.to_s(2) Converts 5 to base 2 (binary) as a string. This is fine for output to a file! Alternatively, if you're looking to set binary write mode for Windows (versus text mode. this is windows only) there is binmode