John,
I think I was overly brief in my query. If the attribute doesn't
require additional space then it should, in my view, be possible to
update the file without regenerating from scratch. [I have always been
surprised that the APIs (or rather the part of the NetCDF APIs that are
documented for public consumption) don't allow the addition of free
space within the header at definition time which would ameliorate the
problem. Perhaps it's the complexities of garbage collection that led to
the simpler choice.]
In the BODC applications the attributes are normally fixed in size but,
inter alia, represent summary information and need to be updated.
Because of the immediacy of our requirements I'll need to hack the
source code as a temporary expedient. I have done this once before, for
other reasons, with the C library (finding the address of the attribute
within the file) . Any hints (or code) gratefully accepted.
Regards,
Steve Loch
BODC
http://www.bodc.ac.uk
Is there any prospect of a later release permitting the update of the
attributes within a NetCDF file without having to regenerate the
complete file?
The APIs I have used to date including Fortran, C and Matlab don't
have
this restriction.
Steve Loch
British Oceanographic Dta Centre
we will support attribute modification in the next version of
netcdf-java (2.2), which may be ready by end of year (?)
as to whether that can be done without rewriting the file depends on
the
file; we are constrained by the version 1 file format. what would you
need in that regard?
netcdf-4 (on top of HDF5) should be able to modify attributes without
rewriting entire file.