Skip to content

Commit

Permalink
HDF5: Create file if it doesn't exist yet
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Jul 5, 2021
1 parent 8adccde commit 4537dff
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/IO/HDF5/HDF5IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,14 @@ HDF5IOHandlerImpl::createFile(Writable* writable,
flags = H5F_ACC_TRUNC;
break;
case Access::APPEND:
flags = H5F_ACC_RDWR;
if( auxiliary::file_exists( name ) )
{
flags = H5F_ACC_RDWR;
}
else
{
flags = H5F_ACC_TRUNC;
}
break;
case Access::READ_WRITE:
flags = H5F_ACC_EXCL;
Expand Down

0 comments on commit 4537dff

Please sign in to comment.