Page tree

The license could not be verified: License Certificate has expired!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »









Opens an attribute for an object specified by object identifier and attribute name.


H5A_OPEN(obj_id, attr_name, aapl_id)


hid_t H5Aopen(hid_t obj_id, const char *attr_name, hid_t aapl_id)

Fortran90 Interface: h5aopen_f 
SUBROUTINE h5aopen_f(obj_id, attr_name, attr_id, hdferr, aapl_id) IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier CHARACTER(LEN=*), INTENT(IN) :: attr_name ! Attribute name INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier INTEGER, INTENT(OUT) :: hdferr ! Error code: ! 0 on success and -1 on failure INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id ! Attribute access property list END SUBROUTINE h5aopen_f

Insert C++ Function Signature Here (or delete this box if there is no C++ wrapper function)

Insert JAVA Function Signature Here (or delete this box if there is no JAVA wrapper function).

hid_t obj_idIN: Identifer for object to which attribute is attached
const char * attr_name    IN: Name of attribute to open
hid_t aapl_idIN: Attribute access property list

H5Aopen opens an existing attribute, attr_name, that is attached to an object specified an object identifier, object_id.

The attribute access property list, aapl_id, is currently unused and should currently be H5P_DEFAULT.

This function, H5Aopen_by_idx , or H5Aopen_by_name must be called before an attribute can be accessed for any further purpose, including reading, writing, or any modification.

The attribute identifier returned by this function must be released with H5Aclose or resource leaks will develop.


Returns an attribute identifier if successful; otherwise returns a negative value.


    file = H5Fopen (FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
    dset = H5Dopen (file, DATASET, H5P_DEFAULT);
    attr = H5Aopen (dset, ATTRIBUTE, H5P_DEFAULT);

  INTEGER(HID_T)  :: file, space, dset,attr ! Handles
  INTEGER :: hdferr
  INTEGER(hsize_t),   DIMENSION(1:2) :: dims = (/dim0, dim1/)
  INTEGER, DIMENSION(1:dim0, 1:dim1), TARGET :: wdata ! Write buffer
  INTEGER, DIMENSION(:,:), ALLOCATABLE, TARGET :: rdata ! Read buffer
  INTEGER(HSIZE_T), DIMENSION(1:2) :: maxdims
  INTEGER :: i, j
  TYPE(C_PTR) :: f_ptr
  ! Initialize FORTRAN interface.

c++ / examples / create.cpp [33:43]  1.10/master  HDFFV/hdf5
int main (void)
    * Data initialization.
   int i, j;
   int data[NX][NY];          // buffer for data to write
   for (j = 0; j < NX; j++)
      for (i = 0; i < NY; i++)

public class H5Ex_D_Chunk {
    private static String FILENAME = "H5Ex_D_Chunk.h5";
    private static String DATASETNAME = "DS1";
    private static final int DIM_X = 6;
    private static final int DIM_Y = 8;
    private static final int CHUNK_X = 4;
    private static final int CHUNK_Y = 4;
    private static final int RANK = 2;
    private static final int NDIMS = 2;

Release    C
1.8.0Function introduced in this release.

--- Last Modified: November 07, 2017 | 03:28 PM