HDF_LIB_INFO

The HDF_LIB_INFO procedure returns information about the HDF Library being used by this version of IDL, or information about the version of HDF used to create a particular HDF file.

Calling Sequence

HDF_LIB_INFO, [FileHandle]

Arguments

FileHandle

The HDF filehandle returned from a previous call to HDF_OPEN .

Keywords

MAJOR

Set this keyword equal to a named variable that will contain the major version number of the HDF library currently in use by IDL. If the FileHandle argument is supplied, the variable will contain the major version number of the HDF library used by that particular HDF file.

MINOR

Set this keyword equal to a named variable that will contain the minor version number of the HDF library currently in use by IDL. If the FileHandle argument is supplied, the variable will contain the minor version number of the HDF library used by that particular HDF file.

RELEASE

Set this keyword equal to a named variable that will contain the release number of the HDF library currently in use by IDL. If the FileHandle argument is supplied, the variable will contain the release number of the HDF library used by that particular HDF file.

VERSION

Set this keyword equal to a named variable that will contain the version number text string of the HDF library currently in use by IDL. If the FileHandle argument is supplied, the variable will contain the version number text string of the HDF library used by that particular HDF file.

 

Example

HDF_LIB_INFO, MAJOR=MAJOR, MINOR=MINOR, VERSION=VER, RELEASE=REL

PRINT, 'IDL ', !version.release, ' uses HDF Library ', $

    MAJOR, MINOR, REL, FORMAT='(A,A,A,I1,".",I1,"r",I1,A)'

PRINT, V

IDL prints:

IDL 5.1 uses HDF Library 4.0r2

NCSA HDF Version 4.0 Release 2, July 19, 1996

The following example tests the version of HDF used to create a particular file. Note that the strings returned will depend solely upon the version of the HDF library used to create the file. In this example, it is the same as the library compiled into the current version of IDL since it is the current IDL that is creating the file.

file='example.hdf'

id=HDF_OPEN(file, /CREATE)

HDF_LIB_INFO, id, VERSION=VER

PRINT, 'The file ', file,' was created with : ', VER

HDF_CLOSE, id

For this example in IDL 5.1, IDL prints:

The file example.hdf was created with :

NCSA HDF Version 4.0 Release 2, July 19, 1996