From: Tim Hunter Date: 2008-06-12T07:34:08+09:00 Subject: Re: write byte array to file Rajesh Olafson wrote: >>> I have method that read a binary file - maybe a image, and return a byte >>> array. >>> >>> I want write the byte array to another file. But I keep writing the bytes >>> as >>> text. I want binary. >>> >>> What need I do? >>> >>> Rajesh. >>> >>> >> I'm guessing that you're on Windows. Open the file with the 'b' flag, i.e. >> 'wb'. >> > > Thank you. > no. I use linux ubuntu. shold have said that before. > > With my file write I just get text in the file. Not binary. > ? > Then I don't understand. What do you mean you "just get text"? If you're on Linux or you've opened the file with the b flag, then you should get the data you write w/o conversion. Maybe it would help if you showed an example of your code. -- RMagick: http://rmagick.rubyforge.org/ RMagick 2: http://rmagick.rubyforge.org/rmagick2.html