fixed true/false and added missing h5_interm_group example (#5092)

This commit is contained in:
Scot Breitenfeld
2024-11-13 05:18:14 -08:00
committed by GitHub
parent 9019113587
commit 915a7ab591
2 changed files with 5 additions and 4 deletions
+1
View File
@@ -17,6 +17,7 @@ set (examples
h5_chunk_read
h5_compound
h5_group
h5_interm_group
h5_select
h5_attribute
h5_mount
+4 -4
View File
@@ -53,7 +53,7 @@ main(void)
/*
* Check if group /G1 exists in the file.
*/
if (H5Lexists(file, "/G1", H5P_DEFAULT) != FALSE)
if (H5Lexists(file, "/G1", H5P_DEFAULT) != false)
printf("Group /G1 exists in the file\n");
/*
@@ -64,13 +64,13 @@ main(void)
/* Next commented call causes error stack to be printed out; the next one
* works fine; is it a bug or a feature? EIP 04-25-07
*/
/* if (H5Lexists(g1_id, "G2/G3", H5P_DEFAULT) !=TRUE) { */
if (H5Lexists(g1_id, "G2", H5P_DEFAULT) != TRUE) {
/* if (H5Lexists(g1_id, "G2/G3", H5P_DEFAULT) !=true) { */
if (H5Lexists(g1_id, "G2", H5P_DEFAULT) != true) {
grp_crt_plist = H5Pcreate(H5P_LINK_CREATE);
/* Set flag for intermediate group creation */
status = H5Pset_create_intermediate_group(grp_crt_plist, TRUE);
status = H5Pset_create_intermediate_group(grp_crt_plist, true);
g3_id = H5Gcreate2(g1_id, "G2/G3", grp_crt_plist, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(g3_id);
}