Unidata / netcdf-cxx4

Official GitHub repository for netCDF-C++ libraries and utilities.
Other
126 stars 49 forks source link

No access to the NC_SHARE flag. #55

Closed ernestum closed 6 years ago

ernestum commented 6 years ago

The NC_SHARE flag can not be accessed from this c++ library. Is there any particular reason for this? You can read more about the NC_SHARE flage here.

WardF commented 6 years ago

This is odd, it should be available. What happens when you try to open a file, and specify NC_SHARE?

ernestum commented 6 years ago

It is just plain not possible. If you have a look at the open method of ncFile where the nc_open/nc_create of the underlying c library is called, you see, that there is no way for me to control flags directly. I can only indirectly make it use one of NC_WRITE, NC_NOWRITE, NC_NETCDF4 | NC_NOCLOBBER, NC_NETCDF4 | NC_CLOBBER based on the file mode that I provide. This is by the way the only place in the library, that nc_create/nc_open are called. That means the is not other detour I could take to get the NC_SHARE flag in.

WardF commented 6 years ago

Updated ncFile.cpp to add a constructor that will take any/all flags from netcdf.h. Got a test in the pipeline now, will close this out once it's merged.