diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-04-21 18:36:10 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-04-21 18:36:10 (GMT) |
commit | 8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23 (patch) | |
tree | 5c5dce61c112c4f31ec0bfb5b65b00f2157269a7 /tools/src/h5ls/h5ls.c | |
parent | c6097935d5be4c3750b9bf9167783ad28158905b (diff) | |
download | hdf5-8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23.zip hdf5-8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23.tar.gz hdf5-8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23.tar.bz2 |
Added VOL command-line options to (p)h5diff, h5ls, h5dump, and h5mkgrp.
Diffstat (limited to 'tools/src/h5ls/h5ls.c')
-rw-r--r-- | tools/src/h5ls/h5ls.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 3036ae9..765ab63 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -218,6 +218,12 @@ usage (void) PRINTVALSTREAM(rawoutstream, " ...<kerberos cache path>,<username>,<buffer size>)\n"); PRINTVALSTREAM(rawoutstream, " If absent or A == '(,,,,)', all default values are used.\n"); PRINTVALSTREAM(rawoutstream, " Has no effect if vfd flag is not 'hdfs'.\n"); + PRINTVALSTREAM(rawoutstream, " --vol-value Value (ID) of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-name Name of the VOL connector to use for opening the\n"); + PRINTVALSTREAM(rawoutstream, " HDF5 file specified\n"); + PRINTVALSTREAM(rawoutstream, " --vol-info VOL-specific info to pass to the VOL connector used for\n"); + PRINTVALSTREAM(rawoutstream, " opening the HDF5 file specified\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " file/OBJECT\n"); PRINTVALSTREAM(rawoutstream, " Each object consists of an HDF5 file name optionally followed by a\n"); @@ -2854,6 +2860,8 @@ main(int argc, const char *argv[]) H5E_auto2_t tools_func; void *edata; void *tools_edata; + hbool_t custom_vol_fapl = FALSE; + h5tools_vol_info_t vol_info; #ifdef H5_HAVE_ROS3_VFD /* Default "anonymous" S3 configuration */ @@ -2892,6 +2900,9 @@ main(int argc, const char *argv[]) H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); H5Eset_auto2(H5tools_ERR_STACK_g, NULL, NULL); + /* Initialize fapl info struct */ + HDmemset(&vol_info, 0, sizeof(h5tools_vol_info_t)); + /* Build object display table */ DISPATCH(H5O_TYPE_GROUP, "Group", NULL, NULL); DISPATCH(H5O_TYPE_DATASET, "Dataset", dataset_list1, dataset_list2); @@ -2955,6 +2966,19 @@ main(int argc, const char *argv[]) else if (!HDstrncmp(argv[argno], "--vfd=", (size_t)6)) { preferred_driver = argv[argno]+6; } + else if (!HDstrncmp(argv[argno], "--vol-value=", (size_t)12)) { + vol_info.type = VOL_BY_VALUE; + vol_info.u.value = (H5VL_class_value_t)HDatoi(argv[argno]+12); + custom_vol_fapl = TRUE; + } + else if (!HDstrncmp(argv[argno], "--vol-name=", (size_t)11)) { + vol_info.type = VOL_BY_NAME; + vol_info.u.name = argv[argno]+11; + custom_vol_fapl = TRUE; + } + else if (!HDstrncmp(argv[argno], "--vol-info=", (size_t)11)) { + vol_info.info_string = argv[argno]+11; + } else if (!HDstrncmp(argv[argno], "--width=", (size_t)8)) { width_g = (int)HDstrtol(argv[argno]+8, &rest, 0); @@ -3147,6 +3171,14 @@ main(int argc, const char *argv[]) leave(EXIT_FAILURE); } + /* Setup a custom fapl for file accesses */ + if (custom_vol_fapl) { + if ((fapl_id = h5tools_get_fapl(H5P_DEFAULT, &vol_info, NULL)) < 0) { + error_msg("failed to setup file access property list (fapl) for file\n"); + leave(EXIT_FAILURE); + } + } + if (preferred_driver) { h5tools_vfd_info_t vfd_info; |