H5D_CREATE1 creates a data set with a name,
name, in the location specified by the identifier
loc_id may be a file, group, dataset, named datatype or attribute. If an attribute, dataset, or named datatype is specified for
loc_id then the dataset will be created at the location where the attribute, dataset, or named datatype is attached.
name can be a relative path based at
loc_id or an absolute path from the root of the file. Use of this function requires that any intermediate groups specified in the path already exist.
The dataset’s datatype and dataspace are specified by
space_id, respectively. These are the datatype and dataspace of the dataset as it will exist in the file, which may differ from the datatype and dataspace in application memory.
Names within a group are unique: H5D_CREATE1 will return an error if a link with the name specified in
name already exists at the location specified in
As is the case for any object in a group, the length of a dataset name is not limited.
dcpl_id is an
H5P_DATASET_CREATE property list created with H5P_CREATE1 and initialized with various property list functions described in Property List Interface.
H5D_CREATE and H5D_CREATE_ANON return an error if the dataset’s datatype includes a variable-length (VL) datatype and the fill value is undefined, i.e., set to
NULL in the dataset creation property list. Such a VL datatype may be directly included, indirectly included as part of a compound or array datatype, or indirectly included as part of a nested compound or array datatype.
H5D_CREATE and H5D_CREATE_ANON return a dataset identifier for success or a negative value for failure. The dataset identifier should eventually be closed by calling H5D_CLOSE to release resources it uses.
See H5D_CREATE_ANON for discussion of the differences between H5D_CREATE and H5D_CREATE_ANON.
Fill values and space allocation:
The HDF5 library provides flexible means of specifying a fill value, of specifying when space will be allocated for a dataset, and of specifying when fill values will be written to a dataset. For further information on these topics, see the document Fill Value and Dataset Storage Allocation Issues in HDF5 and the descriptions of the following HDF5 functions in this HDF5 Reference Manual:
This information is also included in the “HDF5 Datasets” chapter of the new HDF5 User's Guide, which is being prepared for release.