def export_manifest(manifest, output_fs, filename='manifest.csv'):
    """Write a manifest file."""
    lines = ['"path","md5","auth md5"']
    for path, file_hash, auth_hash in manifest:
        lines.append('"{}",{},{}'.format(path.replace('"', '\\"'),
            file_hash, auth_hash))
    manifest_data = '\n'.join(lines)
    output_fs.settext(filename, manifest_data, encoding='utf-8')
