Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit fc8ec60

Browse files
committed
Fallback to HDF5 in case of big endian architectures.
Fixes #90
1 parent 6cce140 commit fc8ec60

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Field3DFile.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,19 @@ bool Field3DInputFile::open(const string &filename)
826826
"In file: " + filename + " - Bad file hierarchy. ");
827827
success = false;
828828
}
829+
catch (runtime_error &e) {
830+
// HDF5 fallback
831+
m_hdf5.reset(new Field3DInputFileHDF5);
832+
m_hdf5Base = m_hdf5;
833+
if (m_hdf5->open(filename)) {
834+
// Handled. Just return.
835+
return true;
836+
} else {
837+
Msg::print(Msg::SevWarning,
838+
"In file: " + filename + ": " + string(e.what()));
839+
success = false;
840+
}
841+
}
829842
catch (...) {
830843
Msg::print(Msg::SevWarning,
831844
"In file: " + filename + " Unknown exception ");

0 commit comments

Comments
 (0)