Skip to content

Commit 4537dff

Browse files
committed
HDF5: Create file if it doesn't exist yet
1 parent 8adccde commit 4537dff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/IO/HDF5/HDF5IOHandler.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,14 @@ HDF5IOHandlerImpl::createFile(Writable* writable,
182182
flags = H5F_ACC_TRUNC;
183183
break;
184184
case Access::APPEND:
185-
flags = H5F_ACC_RDWR;
185+
if( auxiliary::file_exists( name ) )
186+
{
187+
flags = H5F_ACC_RDWR;
188+
}
189+
else
190+
{
191+
flags = H5F_ACC_TRUNC;
192+
}
186193
break;
187194
case Access::READ_WRITE:
188195
flags = H5F_ACC_EXCL;

0 commit comments

Comments
 (0)