Skip to content
Snippets Groups Projects
Commit 06c405e5 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdfOpenFile(): check uri.

parent 8db02c61
No related branches found
No related tags found
No related merge requests found
Pipeline #19248 failed
...@@ -141,20 +141,22 @@ cdfOpenFile(const char *filename, const char *mode, int *filetype) ...@@ -141,20 +141,22 @@ cdfOpenFile(const char *filename, const char *mode, int *filetype)
if (*filetype == CDI_FILETYPE_NC4C) writemode |= (NC_NETCDF4 | NC_CLASSIC_MODEL); if (*filetype == CDI_FILETYPE_NC4C) writemode |= (NC_NETCDF4 | NC_CLASSIC_MODEL);
if (*filetype == CDI_FILETYPE_NCZARR) writemode |= NC_NETCDF4; if (*filetype == CDI_FILETYPE_NCZARR) writemode |= NC_NETCDF4;
#endif #endif
const bool hasUri = has_uri(filename);
if (*filetype == CDI_FILETYPE_NCZARR) if (*filetype == CDI_FILETYPE_NCZARR)
{ {
if (has_uri(filename)) if (!hasUri)
{
cdf_create(filename, writemode, &ncid);
}
else
{ {
fprintf(stderr, "URI is missing in NCZarr path!\n"); fprintf(stderr, "URI is missing in NCZarr path!\n");
return CDI_EINVAL; return CDI_EINVAL;
} }
cdf_create(filename, writemode, &ncid);
} }
else else
{ {
if (hasUri) fprintf(stderr, "URI defined for non NCZarr Data Model!\n");
cdf__create(filename, writemode, &ncid); cdf__create(filename, writemode, &ncid);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment