# File lib/backports/tools.rb, line 305 def self.write(binary, filename, string, offset, options) offset, options = nil, offset if Hash === offset and options == Backports::Undefined options = {} if options == Backports::Undefined options = {:mode => offset.nil? ? "w" : "r+"}.merge(options) args = options[:open_args] || [options] File.open(filename, *args) do |f| f.binmode if binary && f.respond_to?(:binmode) f.seek(offset) unless offset.nil? f.write(string) end end