HDF_DFAN_GETFDS

The HDF_DFAN_GETFDS procedure reads the next available file description from an HDF file.

Calling Sequence

HDF_DFAN_GETFDS, Filename, Description

Arguments

Filename

A string containing the name of the file to be read.

Description

A named variable in which the description is returned. By default, the description is returned as a vector of bytes. Set the STRING keyword to return the description as a string.

If a description does not exist, the Description variable will contain either a 0L (long-integer zero) or a blank string, and a warning message will be printed. Warning messages can be suppressed by setting the !QUIET system variable to a non-zero value.

Keywords

FIRST

Set this keyword to read the first file description in the file. If FIRST is not set, the next available file description (which can be the first file description) will be read.

STRING

Set this keyword to return Description as a string instead of a vector of bytes.

Example

filename = 'DEMOfds.hdf'

fds1 = 'FILE DESCRIPTION NUMBER 1'

fds2 = 'SHORT FDS 2'

fid = HDF_OPEN(filename, /CREATE) ; Create an HDF file.

HDF_DFAN_ADDFDS, filename, fds1 ; Add first file description.

HDF_DFAN_ADDFDS, filename, fds2 ; Add second file description.

 

HDF_DFAN_GETFDS, filename, out_fds1, /FIRST
; Get the first file description.

HELP, out_fds1

IDL prints:

OUT_FDS1 BYTE = Array(25)

PRINT, STRING(out_fds1)

IDL prints:

FILE DESCRIPTION NUMBER 1

HDF_DFAN_GETFDS, filename, out_fds2, /STRING
; Get the second file description.

HELP, out_fds2

IDL prints:

OUT_FDS2 STRING = 'SHORT FDS 2'

HDF_CLOSE, fid ; Close the HDF file.

See Also

HDF_DFAN_ADDFDS , HDF_DFAN_ADDFID , HDF_DFAN_GETDESC , HDF_DFAN_GETFID