Recursively reading file information from some file get infinite recycling

Hi, All:

   I am trying to recursively collection all information of a HDF5 file(which is attached). I found there is User defined link data in this file. My application got runtime error because the callstack is too deep and I suspect there exist dead link in it. I wonder how to avoid this infinite recursive call in this case. Any help will be greatly appreciated.

textlinktar.h5 (6.59 KB)

···

--

How are you getting this error? I've tried a couple things with your
attached file but can examine it OK:

% ~/work/soft/hdf5-1.8.2/bin/h5ls -f -r ~/textlinktar.h5
/ Group
/dset Dataset {6}
/empty_group Group
/group Group
/group/dset Dataset {6}
/group/elink_t1 External Link {textlinksrc.h5//}
/group/elink_t2 External Link {textlinksrc.h5//ext_link4}
/group/subgroup Group
/group/subgroup/link_to_group Group, same as /group
/type Type

% ~/work/soft/hdf5-1.8.2/bin/h5dump -H ~/textlinktar.h5
HDF5 "/home/robl/textlinktar.h5" {
GROUP "/" {
   DATASET "dset" {
      DATATYPE H5T_STD_I32LE
      DATASPACE SIMPLE { ( 6 ) / ( 6 ) }
   }
   GROUP "empty_group" {
   }
   GROUP "group" {
      DATASET "dset" {
         DATATYPE H5T_STD_I32LE
         DATASPACE SIMPLE { ( 6 ) / ( 6 ) }
      }
      EXTERNAL_LINK "elink_t1" {
         TARGETFILE "textlinksrc.h5"
         TARGETPATH "/"
      }
      EXTERNAL_LINK "elink_t2" {
         TARGETFILE "textlinksrc.h5"
         TARGETPATH "/ext_link4"
      }
      GROUP "subgroup" {
         GROUP "link_to_group" {
            HARDLINK "/group"
         }
      }
   }
   DATATYPE "type" H5T_STD_I32LE;

}
}

==rob

···

On Tue, Sep 15, 2009 at 09:28:29AM +0800, 暮如雪 wrote:

I am trying to recursively collection all information of a HDF5
file(which is attached). I found there is User defined link data in
this file. My application got runtime error because the callstack is
too deep and I suspect there exist dead link in it. I wonder how to
avoid this infinite recursive call in this case. Any help will be
greatly appreciated.

--
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA