3.6 Find a Group's Full Name: nc_inq_grpname_full
Given ncid, find complete name of group. (Root group is named "/", a
full "path" for each group is provided in the name, with groups
separated with a forward slash / as in Unix directory names. For
example "/group1/subgrp1/subsubgrp1")
Usage
int nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name);
ncid
- The group id for this operation.
lenp
- Pointer to a size_t which will get the length. (Note that this does
not include the NULL terminator byte.)
full_name
- Pointer to allocated space of correct length. The name of the
group will be copied there. To find the required length, call
nc_inq_grpname_len call this function with NULL for the full_name
parameter, or call (see nc_inq_grpname_len).
-
Errors
NC_NOERR
- No error.
NC_EBADID
- Bad group id.
NC_ENOTNC4
- Attempting a netCDF-4 operation on a netCDF-3 file. NetCDF-4
operations can only be performed on files defined with a create mode
which includes flag HDF5. (see nc_open).
NC_ESTRICTNC3
- This file was created with the strict netcdf-3 flag, therefore
netcdf-4 operations are not allowed. (see nc_open).
NC_EHDFERR
- An error was reported by the HDF5 layer.
Example
This example is from the test program libsrc4/tst_grps.c.
int grpid_in[MAX_SIBLING_GROUPS];
char full_name_in[NC_MAX_NAME * 10];
size_t len;
...
if (nc_inq_grpname_full(grpid_in[0], &len, full_name_in)) ERR;