This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> 1. The examples in the docs for NC_DISKLESS should change the > filename from "foo_HDF5_classic.nc" to "diskless.nc". Will do. > 2. NC_DISKLESS should not be used (and causes a failure) when > used to nc_open() netCDF4 files. If a file's format is not known > a priori, then one must use nc_open() to determine its format. So > the only way I can think of to determine whether it is safe to > use NC_DISKLESS to nc_open() a file is to first open the file > without NC_DISKLESS, then query its format, then if it is netCDF3 > close it and re-open it with NC_DISKLESS. Is this algorithm > correct/optimal? I want to stay within the API and not inspect > for type using magic numbers. Let me propose an alternative, namely nc_open() on a netcdf-4 file with NC_DISKLESS will not fail, but will ignore the flag. Can you see any problems with that? =Dennis Heimbigner Unidata Ticket Details =================== Ticket ID: FMC-393036 Department: Support netCDF Priority: Normal Status: Closed