def write_file(path, content)
      dir = File.dirname(path)
      if !File.exist?(dir)
        FileUtils.mkdir_p(dir)
      end
      File.open(path, 'wb') do |f|
        f.write(content)
      end
    end
def write_file(path, content)
      dir = File.dirname(path)
      if !File.exist?(dir)
        FileUtils.mkdir_p(dir)
      end
      File.open(path, 'wb') do |f|
        f.write(content)
      end
    end
Writes the given content to the file at the given path. If or or more
 parent directories don't exist, then they are created.