summaryrefslogtreecommitdiffstats
path: root/src/H5FDsubfiling/H5FDioc.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-02-26 18:12:00 (GMT)
committerGitHub <noreply@github.com>2023-02-26 18:12:00 (GMT)
commit49fdba1091e36df98dd0b2bef2a6246c7372a01b (patch)
tree45846cafc7a3d616133affedf398462657163246 /src/H5FDsubfiling/H5FDioc.c
parentea5b3952f71ae613830ece0a4416656ecacf070d (diff)
downloadhdf5-49fdba1091e36df98dd0b2bef2a6246c7372a01b.zip
hdf5-49fdba1091e36df98dd0b2bef2a6246c7372a01b.tar.gz
hdf5-49fdba1091e36df98dd0b2bef2a6246c7372a01b.tar.bz2
Subfiling VFD - add option to specify config file prefix (#2495)
Diffstat (limited to 'src/H5FDsubfiling/H5FDioc.c')
-rw-r--r--src/H5FDsubfiling/H5FDioc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c
index 152c045..2fd8b64 100644
--- a/src/H5FDsubfiling/H5FDioc.c
+++ b/src/H5FDsubfiling/H5FDioc.c
@@ -1455,6 +1455,7 @@ H5FD__ioc_del(const char *name, hid_t fapl)
if (mpi_rank == 0) {
int64_t read_n_subfiles = 0;
int32_t n_subfiles = 0;
+ char *prefix_env = NULL;
int num_digits = 0;
if (HDstat(name, &st) < 0)
@@ -1470,9 +1471,13 @@ H5FD__ioc_del(const char *name, hid_t fapl)
H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL,
"can't allocate config file name buffer");
+ /* Check if a prefix has been set for the configuration file name */
+ prefix_env = HDgetenv(H5FD_SUBFILING_CONFIG_FILE_PREFIX);
+
/* TODO: No support for subfile directory prefix currently */
- HDsnprintf(tmp_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, file_dirname,
- base_filename, (uint64_t)st.st_ino);
+ /* TODO: Possibly try loading config file prefix from file before deleting */
+ HDsnprintf(tmp_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE,
+ prefix_env ? prefix_env : file_dirname, base_filename, (uint64_t)st.st_ino);
if (NULL == (config_file = HDfopen(tmp_filename, "r"))) {
if (ENOENT == errno) {