Skip to content

Commit f37fe57

Browse files
committed
added check for DAOS file
1 parent 1a6228f commit f37fe57

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

libdispatch/dinfermodel.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,27 @@ NC_infermodel(const char* path, int* omodep, int iscreate, int useparallel, void
490490
int omode = *omodep;
491491
NClist* modeargs = nclistnew();
492492

493+
#if H5_VERSION_GE(1,12,0)
494+
495+
hid_t fapl_id;
496+
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto done;
497+
// printf("testing if %s accessible \n", path);
498+
if( H5Fis_accessible(path, fapl_id) == 1 ) {
499+
500+
hid_t H5VL_id = H5VLget_connector_id(fapl_id);
501+
if( H5VL_id != H5VL_NATIVE && H5VL_id != H5I_INVALID_HID) {
502+
printf("DAOS OBJECT is %s accessible \n", path);
503+
model->impl = NC_FORMATX_NC4;
504+
model->format = NC_FORMAT_NETCDF4;
505+
if (H5Pclose(fapl_id) < 0) goto done;
506+
goto done;
507+
}
508+
}
509+
510+
if (H5Pclose(fapl_id) < 0) goto done;
511+
512+
#endif
513+
493514
/* Phase 1: Reformat the uri to canonical form; store canonical form
494515
into newpath. Return the "mode=" list in modeargs */
495516
if((stat = processuri(path, &uri, &newpath, modeargs))) goto done;

0 commit comments

Comments
 (0)