From: krzysztof cierpisz Date: 2009-08-19T01:10:16+09:00 Subject: Re: fromdos dos2unix in ruby > Try something like this: > > buffer = '' > File.open(ARGV[1], 'wb') do |out|     # open for writing binary >    File.open(ARGV[0], 'rb') do |in|    # open for reading binary >      while in.read(1024, buffer)       # read upto 1024 bytes into   > buffer >        out.write buffer.gsub(/\r\n/, "\n")  # change ending and write   > out >      end >    end                               # end of block closes input > end                                 # end of block closes output > > -Rob > thanks Rob, I just added binary mode to what I had, and now it's working under Windows as well. I am always forgetting about "b" mode under windows. thanks chris