Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Re: Should NetCDF character attributes be null-terminated

At 12:24 PM 08/03/01 +1200, Mark Hadfield wrote:
>Hello all
>
>I started writing the following as a bug report to the IDL people, but now
>I'm not so sure. Perhaps the netCDF experts could give a ruling on this
>matter:
>
>    When an application writes text data to a netCDF file attribute,
>    should it (may it, must it) terminate the data with a null character?

Mark...

I've had to deal with this from Fortran programs as well, and I'd certainly
like to see it "fixed."  I hacked around this by writing a short utility
routine that checks a string to see if it terminates with a '\0' character.
 If so, the null is replaced by a space.  An engineering approach, perhaps,
but it cured what ailed me.

Jim
*---------------------*-------------------------------*
| Jim Secan           | Northwest Research Assoc, Inc |
| (jim@xxxxxxxxxxx)   | 2455 E. Speedway, Suite 203   |
| (520) 319-7773      | Tucson, Arizona 85719         |
|    Space Weather Info: http://www.nwra-az.com/      |
*---------------------*-------------------------------*

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690