Attribute Information Reading
Function Syntax
- Read an attribute of any type.
int ncmpi_get_att(int fileId, int varid, const char* name, void* value);
- Read an attribute of the char type.
int ncmpi_get_att_text(int fileId, int varid, const char* name, char* ip);
- Read an attribute of the int type.
int ncmpi_get_att_int(int fileId, int varid, const char* name, int* ip);
- Read an attribute of the float type.
int ncmpi_get_att_float(int fileId, int varid, const char* name, float* ip);
- Read an attribute of the double type.
int ncmpi_get_att_double(int fileId, int varid, const char* name, double* ip);
Parameters
Parameter |
Description |
Value Range |
Input/Output |
|---|---|---|---|
fileId |
File ID |
Non-negative integer |
Input |
varid |
Variable ID |
Non-negative integer |
Input |
*name |
Attribute name |
Non-empty string of less than 256 bytes |
Input |
*ip |
Pointer to the buffer for reading attribute information |
Non-empty |
Output |
Return Value
- Success: NC_NOERR
- Failure: An error code is returned.
Error Code
Error Code |
Description |
|---|---|
NC_EBADID |
Invalid ncid |
NC_EBADNAME |
Invalid name |
NC_ENOMEM |
Null pointer or invalid memory |
NC_EINVAL |
Invalid argument |