diff options
Diffstat (limited to 'tools/lib/h5tools_utils.c')
-rw-r--r-- | tools/lib/h5tools_utils.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index a0fca8b..361cd6a 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -40,7 +40,8 @@ int opt_err = 1; /*get_option prints errors if this is on */ int opt_ind = 1; /*token pointer */ const char *opt_arg; /*flag argument (or value) */ static int h5tools_d_status = 0; -static const char *h5tools_progname = "h5tools"; +//static const char *h5tools_progname = "h5tools"; +static char *h5tools_progname = "h5tools"; /* ``parallel_print'' variables */ unsigned char g_Parallel = 0; /*0 for serial, 1 for parallel */ @@ -702,9 +703,9 @@ tmpfile(void) #endif /*------------------------------------------------------------------------- - * Function: H5tools_get_link_info + * Function: H5tools_get_symlink_info * - * Purpose: Get link (soft, external) info and its target object type + * Purpose: Get symbolic link (soft, external) info and its target object type (dataset, group, named datatype) and path, if exist * * Patameters: @@ -726,7 +727,7 @@ tmpfile(void) * Date: Feb 8, 2010 *-------------------------------------------------------------------------*/ int -H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, +H5tools_get_symlink_info(hid_t file_id, const char * linkpath, h5tool_link_info_t *link_info, hbool_t get_obj_type) { htri_t l_ret; @@ -738,6 +739,14 @@ H5tools_get_link_info(hid_t file_id, const char * linkpath, h5tool_link_info_t * /* init */ link_info->trg_type = H5O_TYPE_UNKNOWN; + /* if path is root, return group type */ + if(!HDstrcmp(linkpath,"/")) + { + link_info->trg_type = H5O_TYPE_GROUP; + ret = 2; + goto out; + } + /* check if link itself exist */ if(H5Lexists(file_id, linkpath, H5P_DEFAULT) <= 0) { if(link_info->opt.msg_mode == 1) @@ -827,7 +836,7 @@ out: H5Pclose(lapl); return ret; -} /* end H5tools_get_link_info() */ +} /* end H5tools_get_symlink_info() */ /*------------------------------------------------------------------------- * Audience: Public |