{"record":{"id":"68f924f84c43b603","repo":"tonhowtf/omniget","slug":"nenhum-csv-nesta-pasta-aponte-para-a-pasta-do-export-ou-para","errorCode":null,"errorMessage":"nenhum .csv nesta pasta — aponte para a pasta do export ou para o zip","messagePattern":"nenhum \\.csv nesta pasta — aponte para a pasta do export ou para o zip","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/reddit/gdpr.rs","lineNumber":248,"sourceCode":"\n/// Lê os CSV de um zip ou de uma pasta já descompactada.\npub fn read_source(path: &Path) -> Result<HashMap<String, String>> {\n    let mut out = HashMap::new();\n    if path.is_dir() {\n        for entry in walkdir::WalkDir::new(path)\n            .max_depth(3)\n            .into_iter()\n            .flatten()\n        {\n            let p = entry.path();\n            if p.is_file() && is_csv(&p.to_string_lossy()) {\n                if let Ok(text) = read_text(p) {\n                    out.insert(short_name(&p.to_string_lossy()), text);\n                }\n            }\n        }\n        if out.is_empty() {\n            return Err(anyhow!(\n                \"nenhum .csv nesta pasta — aponte para a pasta do export ou para o zip\"\n            ));\n        }\n        return Ok(out);\n    }\n    let lower = path.to_string_lossy().to_ascii_lowercase();\n    if !lower.ends_with(\".zip\") {\n        return Err(anyhow!(\n            \"escolha o zip do export do Reddit ou a pasta onde ele foi descompactado\"\n        ));\n    }\n    let file = std::fs::File::open(path)?;\n    let mut zip =\n        zip::ZipArchive::new(file).map_err(|e| anyhow!(\"não foi possível abrir o zip: {}\", e))?;\n    for i in 0..zip.len() {\n        let mut entry = match zip.by_index(i) {\n            Ok(e) => e,\n            Err(_) => continue,","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/reddit/gdpr.rs#L230-L266","documentation":"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.","triggerScenarios":"run() called with a directory path that contains no *.csv files anywhere beneath it (out.is_empty() after walking).","commonSituations":"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.","solutions":["Point opts at the extracted GDPR export folder that directly contains files like comments.csv, posts.csv","Or pass the original .zip export instead of the folder","List the folder (find . -name '*.csv') to confirm CSVs exist where you think they are","Re-extract the export if the archive was only partially unpacked"],"exampleFix":"// before\nrun(GdprOpts { path: \"~/Downloads\".into(), .. })\n// after\nrun(GdprOpts { path: \"~/Downloads/reddit-export-2026\".into(), .. })","handlingStrategy":"validation","validationCode":"use std::path::Path;\nfn dir_has_csv(dir: &Path) -> bool {\n    walkdir::WalkDir::new(dir)\n        .into_iter()\n        .filter_map(|e| e.ok())\n        .any(|e| e.path().extension().map_or(false, |x| x.eq_ignore_ascii_case(\"csv\")))\n}\n// assert!(dir_has_csv(&export_dir), \"no csv in export folder\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Point the tool at the extracted export root, not an arbitrary folder","Confirm CSVs exist with find <dir> -name '*.csv' before running","Fully extract the zip before passing the folder","Do not confuse tool output directories with the export directory"],"tags":["reddit","gdpr-export","csv","directory"],"backgroundTag":"file-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}