kharm/hdf5_utils.hpp
// Check if an object's name exists: returns 1 if it does
// Doesn't verify if the object itself exists, or anything about it!
Check if an object's name exists: returns 1 if it does
Doesn't verify if the object itself exists, or anything about it!
Check if an object ' s name exists : returns 1 if it does Doesn ' t verify if the object itself exists or anything about it!
int H5F::exists(const char *name)
{
    char path[STRLEN];
    strncpy(path, cur_dir, STRLEN);
    strncat(path, name, STRLEN - strlen(path));
    hid_t link_plist = H5Pcreate(H5P_LINK_ACCESS);
    herr_t exists = H5Lexists(file_id, path, link_plist);
    H5Pclose(link_plist);
    if (DEBUG)
        fprintf(stderr, "Checking existence of %s: %d\n", path, exists);
    return exists > 0;
}
int H5F :: exists ( const char * name ) { char path [ STRLEN ] ; strncpy ( path , cur_dir , STRLEN ) ; strncat ( path , name , STRLEN - strlen ( path ) ) ; hid_t link_plist = H5Pcreate ( H5P_LINK_ACCESS ) ; herr_t exists = H5Lexists ( file_id , path , link_plist ) ; H5Pclose ( link_plist ) ; if ( DEBUG ) fprintf ( stderr , " \n " , path , exists ) ; return exists > 0 ; }
Check if an object's name exists: returns 1 if it does
Doesn't verify if the object itself exists, or anything about it!
Check if an object ' s name exists : returns 1 if it does Doesn ' t verify if the object itself exists or anything about it!