class File

def open_with_options_hash(file, mode = nil, perm = Backports::Undefined, options = Backports::Undefined)

def open_with_options_hash(file, mode = nil, perm = Backports::Undefined, options = Backports::Undefined)
  mode, perm = Backports.combine_mode_perm_and_option(mode, perm, options)
  perm ||= 0666 # Avoid error on Rubinius, see issue #52
  if block_given?
    open_without_options_hash(file, mode, perm){|f| yield f}
  else
    open_without_options_hash(file, mode, perm)
  end
end

def size

def size
  stat.size
end unless method_defined? :size