Re: History attribute

On Thu, 23 Jan 1997, Konrad Hinsen wrote:

> The netCDF manual recommends that each time a file is modified,
> an informative line should be added to the global attribute
> "history". Fine, that would be useful. But if I understood
> chapter 9 of the manual correctly, each such addition to an attribute
> will cause the whole file to be copied, which is rather undesirable.
> Is there any way to prevent this? Perhaps one could somehow reserve
> sufficient space for extension of the history attribute when creating
> the file.

You might like to look at file src/fanlib/put_history.c in my fan system at
ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/fan.tar.Z

This writes following to each line of history:
date, time, LOGNAME, command (with arguments)
as shown in following extract from output from ncdump:

                :history = "24Jan1997 0937; hld; ncrob / z.nc z\n",
    "24Jan1997 0938; hld; ncrob / z.nc z:_FillValue\n",
    "" ;

If attribute does not exist then 1000 bytes are written to leave room for
further lines.  When this fills another 1000 are allocated & so on. The 
trailing bytes are set to 0 (i.e. NUL or '\0').


Harvey Davies, CSIRO Mathematical and Information Sciences,
723 Swanston Street, Carlton, Victoria 3053, Australia            
Email: harvey.davies@xxxxxxxxxxxxx
Phone: +61 3 9282 2623 or +61 3 9239 4556
  Fax: +61 3 9282 2600


  • 1997 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: