The CDF_INQUIRE function returns global information about the Common Data Format file. This information is returned in a structure of the form:
{ NDIMS:0L, DECODING:"", ENCODING:"", MAJORITY:"", MAXREC:0L, $
NVARS:0L, NZVARS:0L, NATTS:0L, DIM:LONARR(NDIMS) }
The tags of this structure are described below.
The longword integer specifying the number of dimensions in the rVariables in the current CDF.
A string describing the decoding type set in the CDF file. For example,
'MAC_DECODING'
or
'ALPHAVMSD_ENCODING'.
A string describing the type of encoding used in the CDF file. For example,
'NETWORK_ENCODING'
or
'SUN_ENCODING'
.
A string describing the majority used in the CDF file. The majority will be either row (
'ROW_MAJOR'
) or column (
'COL_MAJOR'
).
A longword integer specifying the highest record number written in the rVariables in the current CDF. The MAXREC field will contain the value
-1
if no rVariables have yet been written to the CDF.
A longword integer specifying the number of attributes in the CDF. Note that the number returned in this field includes both global and variable attributes. You can use the GET_NUMATTR keyword to the CDF_CONTROL routine to determine the number of each.
cdfid = CDF_CREATE('CDFinquire', /HP_ENCODING, /MAC_DECODING)
attr1_id = CDF_ATTCREATE(cdfid, 'GLOBAL_ATT', /GLOBAL_SCOPE)
attr2_id = CDF_ATTCREATE(cdfid,'VARIABLE_ATT', /VARIABLE_SCOPE)
CDF_CONTROL, cdfid, GET_NUMATTRS = num_attrs
PRINT, 'This CDF has ', num_attrs(0), 'Global attribute(s) and ',$
num_attrs(1), 'Variable attribute(s).', FORMAT='(A,I2,A,I2,A)'
This CDF has 1 Global attribute(s) and 1 Variable attribute(s).
** Structure <4003e0c0>, 9 tags, length=48, refs=1: