summaryrefslogtreecommitdiffstats
path: root/src/H5FDsec2.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-05-05 22:07:40 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-05-05 22:07:40 (GMT)
commit8d4873173fe95ffd8a274c9d9a6c1e8b5e017957 (patch)
tree10a135eaa95a0dfd54925af438504179c439de17 /src/H5FDsec2.c
parent54c202e4ec4bc9c7e45543cea5b51868a091b3e9 (diff)
downloadhdf5-8d4873173fe95ffd8a274c9d9a6c1e8b5e017957.zip
hdf5-8d4873173fe95ffd8a274c9d9a6c1e8b5e017957.tar.gz
hdf5-8d4873173fe95ffd8a274c9d9a6c1e8b5e017957.tar.bz2
Brings native H5Fdelete implementation from develop
Diffstat (limited to 'src/H5FDsec2.c')
-rw-r--r--src/H5FDsec2.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 816381d..c694190 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,7 +172,8 @@ static const H5FD_class_t H5FD_sec2_g = {
H5FD__sec2_truncate, /* truncate */
H5FD__sec2_lock, /* lock */
H5FD__sec2_unlock, /* unlock */
- NULL, /* dedup */
+ H5FD__sec2_delete, /* del */
+ NULL, /* dedup */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -1042,3 +1044,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() */