The HDF_VG_ATTACH procedure attaches (opens) a VGroup in a Hierarchical Data Format file for reading or writing. If successful, a handle for that group is returned. If it fails, 0 is returned.
If VGroupId is set to -1, a new VGroup is created. If neither the READ nor WRITE keywords are set, the VGroup is opened for reading.
See HDF_SD_IDTOREF for an example using this function.