Skip to content

Commit

Permalink
check if the fmuPath is a directory and modelDescription.xml exists
Browse files Browse the repository at this point in the history
  • Loading branch information
prudhomm committed Dec 4, 2023
1 parent 292ee75 commit 82f59e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fmi4cpp/fmi2/fmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ using namespace fmi4cpp::fmi2;

fmu::fmu(const fs::path& fmuPath, bool unzipFmu)
{
if ( fs::is_directory(fmuPath) && fs::exists(fmuPath / "modelDescription.xml") ) {
MLOG_DEBUG("fmuPath is a directory, assuming it is an unzipped FMU");
unzipFmu = false;
}
if (unzipFmu) {
if (!exists(fmuPath)) {
const auto err = "No such file '" + absolute(fmuPath).string() + "'!";
Expand Down

0 comments on commit 82f59e0

Please sign in to comment.