Page tree

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

 

JAVA

FORTRAN

C++

C

 

Link

H5LT_GET_ATTRIBUTE_INFO

Gets information about an attribute

Procedure:

H5LT_GET_ATTRIBUTE_INFO(loc_id, obj_name, attr_name, dims, type_class, type_size)

Signature:

herr_t H5LTget_attribute_info( hid_t loc_id, const char *obj_name, const char *attr_name,  hsize_t *dims, H5T_class_t*type_class, size_t *type_size )

subroutine h5ltget_attribute_info_f(loc_id, dset_name, attr_name, &
                                    dims, type_class, type_size, errcode)
  implicit none
  integer(HID_T), intent(IN) :: loc_id             ! file or group identifier 
  character(LEN=*), intent(IN) :: dset_name        ! name of the dataset 
  character(LEN=*), intent(IN) :: attr_name        ! name of the attribute
  integer(HSIZE_T),dimension(*),intent(INOUT):: dims 
                                                   ! dimensions 
  integer, intent(INOUT)         :: type_class     ! type class
  integer(SIZE_T), intent(INOUT) :: type_size      ! type size
  integer :: errcode                               ! error code
end subroutine h5ltget_attribute_info_f

Parameters:
hid_t   loc_idIN: Identifier of the object ( dataset or group) to read the attribute from
const char * obj_nameIN: The name of the object that the attribute is attached to
const char * attr_nameIN: The attribute name
hsize_t *   dimsOUT: The dimensions of the attribute
H5T_class_t  *   type_classOUT: The class identifier. H5T_class_t is defined in H5Tpublic.h. For a list of valid class types see:  H5T_GET_CLASS
size_t *   type_size

OUT: The size of the datatype in bytes

Description:

H5LT_GET_ATTRIBUTE_INFO gets information about an attribute named  attr_name  attached to the object specified by the name  obj_name.

Returns:

Returns a non-negative value if successful; otherwise returns a negative value.

Example:
 H5T_class_t type_class;
  size_t      type_size;
  hsize_t     dims[0];
             ...
  status = H5LTget_attribute_info( file_id, "/", STRNAME, dims, &type_class, &type_size);
  if ( type_class == H5T_STRING ) {
      printf ("Attribute is a string.\n");
      printf ("String size: %i\n", type_size);

 

 

--- Last Modified: March 26, 2019 | 08:34 AM