{"record":{"id":"45d361948a4873b9","repo":"iOfficeAI/OfficeCLI","slug":"input-file-not-found-inputfile-fullname","errorCode":null,"errorMessage":"Input file not found: {inputFile.FullName}","messagePattern":"Input file not found: (.+?)","errorType":"validation","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"src/officecli/CommandBuilder.Batch.cs","lineNumber":246,"sourceCode":"            }\n            else if (inputFile != null)\n            {\n                // Accept the conventional Unix '-' alias for stdin so\n                // pipelines like `cat ops.json | officecli batch foo.pptx --input -`\n                // don't have to drop --input entirely. Matches the implicit\n                // \"no --input ⇒ read stdin\" branch below; using --input -\n                // makes the intent explicit instead of relying on the\n                // absent-flag default. (TargetMode/Exists checks are\n                // skipped on purpose — '-' is not a path.)\n                if (inputFile.Name == \"-\")\n                {\n                    jsonText = StripBom(StdIn.ReadToEnd());\n                }\n                else\n                {\n                    if (!inputFile.Exists)\n                    {\n                        throw new FileNotFoundException($\"Input file not found: {inputFile.FullName}\");\n                    }\n                    jsonText = File.ReadAllText(inputFile.FullName);\n                }\n            }\n            else\n            {\n                // Read from stdin. File.ReadAllText auto-detects and strips\n                // UTF-8 BOM; Console.In does not. Without an explicit strip,\n                // `cat utf8bom.json | officecli batch foo.pptx` failed\n                // System.Text.Json.Parse with \"'﻿' is an invalid start of\n                // a value\" while `batch --input utf8bom.json` succeeded —\n                // splitting the contract on the input source.\n                jsonText = StripBom(StdIn.ReadToEnd());\n            }\n\n            // Pre-validate: check for unknown JSON fields before deserializing\n            var jsonDoc = System.Text.Json.JsonDocument.Parse(jsonText);\n            // CONSISTENCY(dump-batch-pipeline): `dump --json` wraps the","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/CommandBuilder.Batch.cs#L228-L264","documentation":"Thrown by the `batch` command when --input names a file (not the '-' stdin alias) that does not exist on disk. The explicit inputFile.Exists check at line 244 raises FileNotFoundException with the full path.","triggerScenarios":"`officecli batch file.docx --input /tmp/ops.json` where /tmp/ops.json is absent, mis-spelled, on an unmounted volume, or relative to a different working directory than expected.","commonSituations":"Typo in the path; script ran from a different cwd so a relative path misses; the ops file was generated by a prior step that failed silently; permissions hide the file; the path was templated with an empty variable.","solutions":["Verify the path exists and is readable: `ls -l <input-file>` from the same cwd OfficeCLI runs in.","Use an absolute path to avoid cwd-relative misses.","If you meant stdin, use `--input -` or omit --input entirely (batch reads stdin by default).","Ensure the file-generating step succeeded before invoking batch."],"exampleFix":"# before\nofficecli batch file.docx --input ops.json   # wrong cwd\n\n# after\nofficecli batch file.docx --input /abs/path/ops.json","handlingStrategy":"validation","validationCode":"// Resolve and check the input file before invoking batch.\nvar fi = new FileInfo(inputPath);\nif (inputPath != \"-\" && !fi.Exists)\n    throw new FileNotFoundException($\"batch input not found: {fi.FullName}\");","typeGuard":"// Guard: batch input source is usable.\nstatic bool BatchInputReady(string? src) =>\n    src is null || src == \"-\" || File.Exists(src);","tryCatchPattern":null,"preventionTips":["Use absolute paths for --input to avoid cwd-relative misses.","Pre-check the producing step succeeded (non-empty file) before batch reads it."],"tags":["file-not-found","batch","cli","input"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}