diff options
Diffstat (limited to 'src/H5FDsec2.c')
-rw-r--r-- | src/H5FDsec2.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 6fe1282..d823e3c 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -138,6 +138,7 @@ static herr_t H5FD__sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, h static herr_t H5FD__sec2_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static herr_t H5FD__sec2_lock(H5FD_t *_file, hbool_t rw); static herr_t H5FD__sec2_unlock(H5FD_t *_file); +static herr_t H5FD__sec2_delete(const char *filename, hid_t fapl_id); static const H5FD_class_t H5FD_sec2_g = { "sec2", /* name */ @@ -171,6 +172,7 @@ static const H5FD_class_t H5FD_sec2_g = { H5FD__sec2_truncate, /* truncate */ H5FD__sec2_lock, /* lock */ H5FD__sec2_unlock, /* unlock */ + H5FD__sec2_delete, /* del */ H5FD_FLMAP_DICHOTOMY /* fl_map */ }; @@ -1041,3 +1043,28 @@ H5FD__sec2_unlock(H5FD_t *_file) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD__sec2_unlock() */ + +/*------------------------------------------------------------------------- + * Function: H5FD__sec2_delete + * + * Purpose: Delete a file + * + * Return: SUCCEED/FAIL + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FD__sec2_delete(const char *filename, hid_t H5_ATTR_UNUSED fapl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_STATIC + + HDassert(filename); + + if (HDremove(filename) < 0) + HSYS_GOTO_ERROR(H5E_VFL, H5E_CANTDELETEFILE, FAIL, "unable to delete file") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD__sec2_delete() */ |