Skip to content

how do i get groupid using fileid and group path? #148

Answered by LiorBanai
mayurmungi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,
You have 2 methods:
Hdf5.GroupExists(fileorGroupId, nameOfGroup);

for example:

      string filename = @"d:\test.h5";
      var fileId = Hdf5.OpenFile(filename, true);
      var exist=   Hdf5.GroupExists(fileId, "/root/eit/d1");

for groupId:

        public static long CreateOrOpenGroup(long fileOrGroupId, string groupName)
        {

            return (Hdf5Utils.ItemExists(fileOrGroupId, groupName, Hdf5ElementType.Group))
                ? H5G.open(fileOrGroupId, Hdf5Utils.NormalizedName(groupName))
                : H5G.create(fileOrGroupId, Hdf5Utils.NormalizedName(groupName));
        }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LiorBanai
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants