The HDF_DFAN_ADDFID procedure adds a file annotation to a Hierarchical Data Format file. A file can have multiple annotations added.

Calling Sequence

HDF_DFAN_ADDFID, Filename, Label



A scalar string containing the name of the file to be written.


A string containing the annotation string.


Open and HDF file:

filename = 'FID.hdf'

hid = HDF_OPEN(filename,/CREATE)

Write two file annotations:

HDF_DFAN_ADDFID, filename, 'File Annotation #1'

HDF_DFAN_ADDFID, filename, 'File Annotation #2'

Read the two annotations back:

HDF_DFAN_GETFID, filename, fid1

HDF_DFAN_GETFID, filename, fid2

HELP, fid1, fid2

IDL prints:

FID1 STRING = 'File Annotation #1'

FID2 STRING = 'File Annotation #2'

Try to read a non-existant FID:

HDF_DFAN_GETFID, filename, fid3

IDL prints:

% HDF_DFAN_GETFID: Could not read ID length

Read the FIRST fid again, using the FIRST keyword:

HDF_DFAN_GETFID, filename, fid4, /FIRST

HELP, fid4


FID4 STRING = 'File Annotation #1'

HDF_CLOSE, hid ; Close the HDF file.