Attribute conventions: trailing NUL in text

I want to raise this old problem again and suggest some additions to
documentation.

Some users here have recently had problems with generic software which fails
after reading netCDF text attributes containing a trailing NUL ('\0' i.e.
binary zero) character.  

Russ Rew discussed the problem in his August 2001 message to this group.
This message is at:
http://www.unidata.ucar.edu/cgi-bin/msgout?/glimpse/netcdfgroup-list/1435


He gave the following attribute conventions for generic software:
- On output, do not write a trailing NUL. 
- On input, allow for possible trailing NUL.

This latter input convention is needed because many netCDF files exist which
DO have trailing NULs. I must confess that my fan utility text2nc is one of
the culprits which creates such files.

I suggest the above conventions should be described in both
- the sections headed "Attribute Conventions" in the various netCDF User
Guides
- "Writing NetCDF Files: Best Practices"

This latter document is at:
http://www.unidata.ucar.edu/packages/netcdf/BestPractices.html
(It does mention input conventions, despite the name.)

Finally, I plead with developers of generic software to conform to these
conventions.

Harvey Davies, CSIRO Atmospheric Research,
Private Bag No. 1, Aspendale 3195
E-mail: harvey.davies@xxxxxxxx
Phone: +61 3 9239 4556
  Fax: +61 3 9239 4444


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