H5F_ACC_RDWR - Causes files opened through external links to be opened with write access
H5F_ACC_RDONLY - Causes files opened through external links to be opened with read-only access
H5F_ACC_DEFAULT - Removes any external link file access flag setting from lapl_id, causing the file access flag setting to be taken from the parent file
H5Pset_elink_acc_flags is used to adjust the file access flag used to open files reached through external links. This may be useful to, for example, prevent modifying files accessed through an external link. Otherwise, the target file is opened with whatever flag was used to open the parent.
H5P_SET_ELINK_ACC_FLAGS specifies the file access flag to use to open the target file of an external link. This allows read-only access of files reached through an external link in a file opened with write access, or vice-versa.
The library will normally use the file access flag used to open the parent file as the file access flag for the target file. This function provides a way to override that behavior. The external link traversal callback function set by H5P_SET_ELINK_CB can override the setting from H5P_SET_ELINK_ACC_FLAGS.
Returns a non-negative value if successful; otherwise returns a negative value.
The following code sets the link access property list lapl_id to open external link target files with read-only access:
status = H5Pset_elink_acc_flags(lapl_id, H5F_ACC_RDONLY);