Use H5Giterate and pass your own, user-defined iterator function to it to iterate over the members of a group or a file. The group may contain things other than datasets though. You can use H5Gget_info inside your user-defined iterator function to obtain information about each member of the group and filter on, for example, datasets.
http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-Iterate Note that newer versions of HDF5 use H5Literate in favor of H5Giterate so you may want to use H5Literate instead. If you have the name of a dataset and open it with H5Dopen, you can get information about that dataset with calls like H5Dget_space, H5Dget_type, H5Dget_create_plist, etc. http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html Mark On Mon, 2010-07-12 at 15:24 -0700, Tanzima Zerin Islam wrote: > Hi, > I am totally new to HDF5 and this group. So this question might have > been answered previously... In that case just pointing me to the right > thread will tremendously help. > My questions are: > 1. I have an hdf5 file. Is it possible to iterate through the > different datasets and attributes etc.? If yes, how do I do that? > 2. How do I extract the names of the datasets from this file to begin > with? I know how to extract info of a dataset once its name is given. > > Thanks! I will really appreciate any help. > > --tanzima > -- Mark C. Miller, Lawrence Livermore National Laboratory ================!!LLNL BUSINESS ONLY!!================ [email protected] urgent: [email protected] T:8-6 (925)-423-5901 M/W/Th:7-12,2-7 (530)-753-8511 _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
