comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How to check for existence of an HDF5 group
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to check for existence of an HDF5 group [message #90185 is a reply to message #90182] Sun, 08 February 2015 01:39 Go to previous messageGo to previous message
markb77 is currently offline  markb77
Messages: 217
Registered: July 2006
Senior Member
On Saturday, February 7, 2015 at 7:24:50 PM UTC+1, David Grier wrote:
> Dear Folks,
>
> I want to create new groups within an HDF5 file. Before creating a new group, however,
> I'd like to check whether a group of the same name already exists. What's the right
> way to do this?
>
> Calling H5G_OPEN or H5G_GET_OBJINFO with a new group name throws an error.
> I could write a wrapper routine that catches the error and returns a "group not found"
> value but that seems kludgy.
>
> H5_LIST returns a whole lot of information, which I suppose I could parse. That also seems
> clunky.
>
> Is there a more elegant solution? Something along the lines of FILE_TEST that works
> for HDF5 groups (H5G_TEST, e.g.)?
>
> All the best,
>
> David


hi David,

The way to do it is to use H5_LIST with the FILTER keyword.

Also, I have a routine for this in my library: wmb_h5_group_exists()

which can be found at http://www.github.com/superchromix/wmb_lib

best,
Mark
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL to python bridge Library not loaded: libidl.8.5.dylib
Next Topic: =?UTF-8?B?UmU6INmF2LTYp9mH2K/YqSDYqNix2YbYp9mF2Kwg2LHYp9mF2LIg2KrYrdiqINin2YTYpw==?= رض حلقه 4 الشاب خالد

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 18:53:11 PDT 2025

Total time taken to generate the page: 1.75807 seconds