[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 950710: Netcdf c++ interface rename bug

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.


  • Subject: Re: 950710: Netcdf c++ interface rename bug
  • Date: Wed, 19 Jul 1995 16:29:53 -0600

>Organization: Texas A&M
>Keywords: 199507101951.AA06965 netCDF C++ interface rename bug

Hi Dan,

> The c++ interface to the Var/Dim/Att rename functions does not check
> that the file is in define mode (and can not in the Dim case because
> the private member the_file is const and can't do define_mode()).  The
> fix is to add the define mode check to the rename functions, and make
> the_file for NcDim's non-const.

I think this is not a bug, because the documented specification for the
rename functions is that the file doesn't have to be in define mode if the
new name is no longer than the old name.  In this case, the new name just
overwrites the old name in the file header, and we don't have to go through
the file copying required when new space has to be allocated in the header
for a longer name.  It's a silly little optimization, but I think the
current C++ code implements it correctly.

--Russ