diff options
Diffstat (limited to 'src/H5Tcommit.c')
-rw-r--r-- | src/H5Tcommit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index f580c15..dea6bed 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -334,6 +334,10 @@ H5T_commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) HDassert(type); HDassert(tcpl_id != H5P_DEFAULT); + /* Check if we are allowed to write to this file */ + if(0 == (H5F_INTENT(file) & H5F_ACC_RDWR)) + HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "no write intent on file") + /* * Check arguments. We cannot commit an immutable type because H5Tclose() * normally fails on such types (try H5Tclose(H5T_NATIVE_INT)) but closing |