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.
The HDF filehandle returned from a previous call to HDF_OPEN .
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.
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.
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)'
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.
PRINT, 'The file ', file,' was created with : ', VER
For this example in IDL 5.1, IDL prints:
The file example.hdf was created with :