title: How do I get the native type of HDF5 attribute?
body: <p>I am using Visual Studio (C#) and HDF5 P/Invoke.</p>
  
  <p>I have made an HDF5 file with groups and datasets with attributes of different datatypes (in this case, let's say it is an integer, saved as H5T.NATIVE_INT32, but I have the same problem for other datatypes). Now I am making a code to read data from the HDF5 file. To read the attribute value, I first need to determine the data type of the attribute value. I have tried the following:</p>
  
  <pre><code>attributeId = H5A.open(groupId, attributeName, H5P.DEFAULT);
  hid_t attributeSpace = H5A.get_space(attributeId);
  H5S.class_t extentType = H5S.get_simple_extent_type(attributeSpace);
  hid_t typeId = H5A.get_type(attributeId);
  attributeClass = H5T.get_class(typeId);
  type = H5T.get_native_type(typeId, H5T.direction_t.DEFAULT);
  H5T.close(typeId);
  </code></pre>
  
  <p>However, the resulting variable <code>type</code> does not match with the <code>H5T.NATIVE_INTEGER</code> type, or any other H5T type I can think of. In fact, even</p>
  
  <pre><code>H5T.get_native_type(H5T.NATIVE_INT,H5T.direction_t.DEFAULT) == H5T.NATIVE_INT
  </code></pre>
  
  <p>returns <code>false</code>, so it appears as if <code>H5T.get_native_type()</code> does not return a type, but perhaps a copy or a pointer of it, which is not identical to the type itself. Is this expected behaviour or a bug? Any ideas on how to correctly figure out the type of an attribute value?</p>