Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5A_CREATE2

Creates an attribute attached to a specified object

Procedure:

H5A_CREATE2 ( loc_id, attr_name, type_id, space_id, acpl_id, aapl_id )

Signature:

hid_t H5Acreate2(
            hid_t loc_id, 
            const char *attr_name, 
            hid_t type_id, 
            hid_t space_id, 
            hid_t acpl_id, 
            hid_t aapl_id 
    )

Fortran90 Interface:  h5acreate_f
    
SUBROUTINE h5acreate_f(loc_id, name, type_id, space_id, attr_id, hdferr, &
                       acpl_id, aapl_id )
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: loc_id    ! Object identifier 
  CHARACTER(LEN=*), INTENT(IN) :: name    ! Attribute name
  INTEGER(HID_T), INTENT(IN) :: type_id   ! Attribute datatype identifier    
  INTEGER(HID_T), INTENT(IN) :: space_id  ! Attribute dataspace identifier
  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) :: acpl_id 
                                          ! Attribute creation property 
                                          ! list identifier
  INTEGER(HID_T), OPTIONAL, INTENT(IN) :: aapl_id 
                                          ! Attribute access property 
                                          ! list identifier
END SUBROUTINE h5acreate_f
    


  

Parameters:
hid_t loc_idIN: Location or object identifier
The identifier may be a file, group, dataset, or named datatype. If loc_id is a file identifier, the attribute will be attached to that file’s root group.
const char * attr_name    IN: Attribute name
hid_t type_idIN: Attribute datatype identifier
hid_t space_idIN: Attribute dataspace identifier
hid_t acpl_idIN: Attribute creation property list identifier
(Currently not used; specify H5P_DEFAULT)
hid_t aapl_idIN: Attribute access property list identifier
(Currently not used; specify H5P_DEFAULT)

Description:

H5A_CREATE2 creates an attribute, attr_name, which is attached to the object specified by the identifier loc_id.

The attribute name, attr_name, must be unique for the object.

The attribute is created with the specified datatype and dataspace, type_id and space_id, which are created with the H5T and H5S interfaces, respectively.

If type_id is either a fixed-length or variable-length string, it is important to set the string length when defining the datatype. String datatypes are derived from H5T_C_S1 (or H5T_FORTRAN_S1 for Fortran), which defaults to 1 character in size. See H5T_SET_SIZE and Creating variable-length string datatypes.

The access property list is currently unused, but will be used in the future. This property list should currently be H5P_DEFAULT.

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

Returns:

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

Example:

History:
Release    Change
1.8.0C function introduced in this release.

--- Last Modified: October 23, 2020 | 02:45 PM