Added error if cross sections path is a folder (#3115)

This commit is contained in:
Youssef Badr 2024-08-16 00:56:22 +03:00 committed by GitHub
parent 10c511a0e2
commit e7bc9ba23c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -283,6 +283,10 @@ void read_ce_cross_sections_xml()
{
// Check if cross_sections.xml exists
const auto& filename = settings::path_cross_sections;
if (dir_exists(filename)) {
fatal_error("OPENMC_CROSS_SECTIONS is set to a directory. "
"It should be set to an XML file.");
}
if (!file_exists(filename)) {
// Could not find cross_sections.xml file
fatal_error("Cross sections XML file '" + filename + "' does not exist.");