H5Oopen_by_addropens a group, dataset, or committed (named) datatype using its address within an HDF5 file,addr. The resulting opened object is identical to an object opened withH5Oopenand should be closed withH5Ocloseor an object-type-specific closing function (such asH5Gclose) when no longer needed.
loc_idcan be either the file identifier or a group identifier in the file. In either case, the HDF5 Library uses the identifier only to identify the file.
The object’s address within the file,addr, is the byte offset of the first byte of the object header from the beginning of the HDF5 file space, i.e., from the beginning of the super block (see the “HDF5 Storage Model” section of the “The HDF5 Data Model and File Structure” chapter of theHDF5 User’ Guide).
addrcan be obtained via either of two function calls.H5Gget_objinforeturns the object’s address in theobjnofield of theH5G_stat_tstruct;H5Lget_inforeturns the address in theaddressfield of theH5L_linkinfo_tstruct.
Warning: This function must be used with care! Improper use can lead to inaccessible data, wasted space in the file, orfile corruption.
This function is dangerous if called on an invalid address. The risk can be safely overcome by retrieving the object address withH5Gget_objinfoorH5Lget_linkinfoimmediately before callingH5Oopen_by_addr. The immediacy of the operation can be important; if time has elapsed and the object has been deleted from the file, the address will be invalid and file corruption can result.
The address of the HDF5 file on a physical device has no effect onH5Oopen_by_addr, nor does the use of any file driver. As stated above, the object address is its offset within the HDF5 file; HDF5’s file drivers will transparently map this to an address on a storage device.
Returns an object identifier for the opened object if successful; otherwise returns a negative value.