tonhowtf/omniget · error

nenhum .csv nesta pasta — aponte para a pasta do export ou…

Error message

nenhum .csv nesta pasta — aponte para a pasta do export ou para o zip

What it means

read_source() scanned the given directory recursively for .csv files and found none, so it cannot build the GDPR export dataset. The error directs you to point at the export folder (or the original zip) that actually contains Reddit's CSV files.

Solutions

  1. Point opts at the extracted GDPR export folder that directly contains files like comments.csv, posts.csv
  2. Or pass the original .zip export instead of the folder
  3. List the folder (find . -name '*.csv') to confirm CSVs exist where you think they are
  4. Re-extract the export if the archive was only partially unpacked

Example fix

// before
run(GdprOpts { path: "~/Downloads".into(), .. })
// after
run(GdprOpts { path: "~/Downloads/reddit-export-2026".into(), .. })
Defensive patterns

Strategy: validation

Validate before calling

use std::path::Path;
fn dir_has_csv(dir: &Path) -> bool {
    walkdir::WalkDir::new(dir)
        .into_iter()
        .filter_map(|e| e.ok())
        .any(|e| e.path().extension().map_or(false, |x| x.eq_ignore_ascii_case("csv")))
}
// assert!(dir_has_csv(&export_dir), "no csv in export folder");

Prevention

When it happens

Trigger: run() called with a directory path that contains no *.csv files anywhere beneath it (out.is_empty() after walking).

Common situations: Pointing at the wrong folder (e.g. the tool's own output dir instead of the unzipped export); an export that was extracted incompletely; a folder containing only .zst/.json parts of the export; case-sensitive extension mismatches handled differently by is_csv.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/68f924f84c43b603. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/omniget-core/src/core/tools/reddit/gdpr.rs:248

/// Lê os CSV de um zip ou de uma pasta já descompactada.
pub fn read_source(path: &Path) -> Result<HashMap<String, String>> {
    let mut out = HashMap::new();
    if path.is_dir() {
        for entry in walkdir::WalkDir::new(path)
            .max_depth(3)
            .into_iter()
            .flatten()
        {
            let p = entry.path();
            if p.is_file() && is_csv(&p.to_string_lossy()) {
                if let Ok(text) = read_text(p) {
                    out.insert(short_name(&p.to_string_lossy()), text);
                }
            }
        }
        if out.is_empty() {
            return Err(anyhow!(
                "nenhum .csv nesta pasta — aponte para a pasta do export ou para o zip"
            ));
        }
        return Ok(out);
    }
    let lower = path.to_string_lossy().to_ascii_lowercase();
    if !lower.ends_with(".zip") {
        return Err(anyhow!(
            "escolha o zip do export do Reddit ou a pasta onde ele foi descompactado"
        ));
    }
    let file = std::fs::File::open(path)?;
    let mut zip =
        zip::ZipArchive::new(file).map_err(|e| anyhow!("não foi possível abrir o zip: {}", e))?;
    for i in 0..zip.len() {
        let mut entry = match zip.by_index(i) {
            Ok(e) => e,
            Err(_) => continue,

View on GitHub (pinned to 8600b91f42)