2
0
mirror of https://github.com/Unidata/netcdf-c.git synced 2025-03-31 17:50:26 +08:00

inq path works for netcdf-4

This commit is contained in:
Ed Hartnett 2010-08-19 18:15:48 +00:00
parent 1aedb82327
commit 469731fd88
2 changed files with 16 additions and 2 deletions
libsrc4
nc_test4

@ -2795,6 +2795,11 @@ NC4_inq_path(int ncid, size_t *pathlen, char *path)
if ((retval = nc4_find_nc_grp_h5(ncid, &nc, &grp, &h5)))
return retval;
if (pathlen)
*pathlen = strlen(h5->path);
if (path)
strcpy(path, h5->path);
return NC_NOERR;
}

@ -37,10 +37,19 @@ main(int argc, char **argv)
/* Test with netCDF-4 create. */
if (nc_create(FILE_NAME, NC_NETCDF4, &ncid)) ERR;
/* if (nc_inq_path(ncid, &path_len, path_in)) ERR;
if (path_len != strlen(FILE_NAME) || strcmp(path_in, FILE_NAME)) ERR;*/
if (nc_inq_path(ncid, &path_len, path_in)) ERR;
if (path_len != strlen(FILE_NAME) || strcmp(path_in, FILE_NAME)) ERR;
if (nc_close(ncid)) ERR;
strcpy(path_in, "");
path_len = 0;
/* Test with classic file open. */
if (nc_open(FILE_NAME, 0, &ncid)) ERR;
if (nc_inq_path(ncid, &path_len, path_in)) ERR;
if (path_len != strlen(FILE_NAME) || strcmp(path_in, FILE_NAME)) ERR;
if (nc_close(ncid)) ERR;
strcpy(path_in, "");
path_len = 0;
/* #ifdef USE_DAP */
/* /\* Test with URL. *\/ */