Check if two identifiers refer to the same object


#1

Is there a way to check if two location identifiers (hid_ts) refer to the same underlying object?


#2

Simon, you might wanna take a look at H5Iobject_verify (https://portal.hdfgroup.org/display/HDF5/H5I_OBJECT_VERIFY). You have to know the kind of object though. You can check a handle’s object type via H5Iget_type (https://portal.hdfgroup.org/display/HDF5/H5I_GET_TYPE). There are, of course, corner cases. For example, several functions accept a file handle or a group handle as arguments for the same parameter. It really depends on your definition of “sameness.” As the saying goes: All handles are equal, but some handles are more equal than others. :sunglasses:


#3

Can I just compare fileno and addr (or fileno and token in 1.12) from H5O_GET_INFO?


#4

Yes, that should be fine. (modulo the potential issues w/ fileno) G.