From: Ralph Mason Date: 2002-06-18T16:39:29+09:00 Subject: Re: File Write bug - Ruby mswin Thanks matz, You are exactly right - the string being written had a \n in it. File.new ("wb") fixed the problem. Ralph ----- Original Message ----- From: "Yukihiro Matsumoto" To: "ruby-talk ML" Sent: Tuesday, June 18, 2002 7:28 PM Subject: Re: File Write bug - Ruby mswin > Hi, > > In message "File Write bug - Ruby mswin" > on 02/06/18, "Ralph Mason" writes: > > |I have an application that generated a binary file. It has always worked > |fine, however having recently switched to the mswin version of ruby I find > |that the application nolonger works correctly. The problem is that > |file.write (or file.print) is printing an extra byte! (sometimes) > > On Windows, you might need to open the file with binary mode. Use > "rb" mode specifier. > > matz.