Last modified: 8 May 2009
Name: H5Pset_elink_acc_flags
Signature:
herr_t H5Pset_elink_acc_flags( hid_t lapl_id, unsigned flags )

Purpose:
Sets the external link traversal file access flag in a link access property list.

Motivation:
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.

Description:
H5Pset_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 behaviour. The external link traversal callback function set by H5Pset_elink_cb can override the setting from H5Pset_elink_acc_flags.

Parameters:
hid_t lapl_id      IN: Link access property list identifier
unsigned flags   IN: The access flag for external link traversal.

Valid values include:
  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.

Returns:
Returns a non-negative value if successful; otherwise returns a negative value.

Example Usage:
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);

See Also:
H5Pget_elink_acc_flags,   H5Pset_elink_cb,   H5Fopen,   H5Lcreate_external

History:
Release     Change
1.8.3 C function introduced in this release.