summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r--src/H5FDdirect.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 35da1f1..a1b7b7e 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -137,6 +137,7 @@ static herr_t H5FD__direct_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id,
static herr_t H5FD__direct_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static herr_t H5FD__direct_lock(H5FD_t *_file, hbool_t rw);
static herr_t H5FD__direct_unlock(H5FD_t *_file);
+static herr_t H5FD__direct_delete(const char *filename, hid_t fapl_id);
static const H5FD_class_t H5FD_direct_g = {
"direct", /* name */
@@ -170,6 +171,7 @@ static const H5FD_class_t H5FD_direct_g = {
H5FD__direct_truncate, /* truncate */
H5FD__direct_lock, /* lock */
H5FD__direct_unlock, /* unlock */
+ H5FD__direct_delete, /* del */
H5FD_FLMAP_DICHOTOMY /* fl_map */
};
@@ -1380,4 +1382,29 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FD__direct_unlock() */
+/*-------------------------------------------------------------------------
+ * Function: H5FD__direct_delete
+ *
+ * Purpose: Delete a file
+ *
+ * Return: SUCCEED/FAIL
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5FD__direct_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__direct_delete() */
+
#endif /* H5_HAVE_DIRECT */