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

Re: 950710: Netcdf c++ interface rename bug



>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