{"record":{"id":"7676ce0678b0c4fe","repo":"octobercms/october","slug":"path-failed-to-open-stream-for-export-no-such","errorCode":null,"errorMessage":"{$path}: failed to open stream for export: No such file or directory.","messagePattern":"(.+?): failed to open stream for export: No such file or directory\\.","errorType":"exception","errorClass":"SystemException","httpStatus":null,"severity":"error","filePath":"modules/backend/models/exportmodel/EncodesCsv.php","lineNumber":125,"sourceCode":"        }\n\n        // Add records\n        foreach ($results as $result) {\n            $data = $this->matchDataToColumns($result, $columns);\n            $csv->insertOne($data);\n        }\n\n        // Output\n        if ($options['useOutput']) {\n            $csv->output($options['fileName']);\n            return;\n        }\n\n        // Save to file\n        if ($path = $options['savePath']) {\n            $resource = @fopen($path, 'w+');\n            if (!is_resource($resource)) {\n                throw new SystemException(\"{$path}: failed to open stream for export: No such file or directory.\");\n            }\n            foreach ($csv->chunk(8192) as $chunk) {\n                fwrite($resource, $chunk);\n            }\n            fclose($resource);\n            return;\n        }\n\n        return $csv->toString();\n    }\n}\n","sourceCodeStart":107,"sourceCodeEnd":137,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/backend/models/exportmodel/EncodesCsv.php#L107-L137","documentation":"Error \"{$path}: failed to open stream for export: No such file or directory.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/backend/models/exportmodel/EncodesCsv.php:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}