Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5F_SET_LIBVER_BOUNDS

Enables the switch of version bounds setting for a file

Procedure:

H5F_SET_LIBVER_BOUNDS (file_id, low, high)

Signature:


herr_t H5Fset_libver_bounds(
        hid_t file_id,             
        H5F_libver_t low,             
        H5F_libver_t high     
)

Parameters:
hid_t file_idIN: A file identifier
H5F_libver_t lowIN: The earliest version of the library that will be used for writing objects
H5F_libver_t highIN: The latest version of the library that will be used for writing objects

Description:

H5F_SET_LIBVER_BOUNDS enables the switch of version bounds setting for an open file associated with file_id.

For the parameters low and high, see the description for H5P_SET_LIBVER_BOUNDS.

Returns:

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

Example:

/*

 *       Create a file with fapl setting (A): (H5F_LIBVER_EARLIEST, H5F_LIBVER_V18).

 *       Create a chunked dataset in the file with “no filter edge chunks”, which

  *      is introduced in library release 1.10.

  *      The first attempt to create the dataset should fail with fapl setting (A).

  *      Switch the fapl setting to (B): (H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST).

  *      The second attempt to create the dataset should succeed with fapl setting (B).

  */

/* Create a file access property list */

fapl = H5Pcreate(H5P_FILE_ACCESS);

/* Set the fapl */

H5Pset_libver_bounds(fapl, H5F_LIBVER_EARLIEST,  H5F_LIBVER_V18);

/* Create a file with this fapl */

fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);

/* Set up to create a chunked dataset with “no filter edge chunks” enabled */

sid = H5Screate_simple(2, fix_dims2, NULL);

dcpl = H5Pcreate(H5P_DATASET_CREATE);

H5Pset_chunk(dcpl, 2, fix_chunks2);

H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS);

 

/* Should fail in creating the dataset */

did = H5Dcreate2(fid, “DSETA”, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);

:

:

/* Switch the fapl setting to (H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST) for this opened file. */

H5Fset_libver_bounds(fid, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);

/* Should succeed in creating the dataset */

did = H5Dcreate2(fid, “DSETA”, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);

:

 

History:
ReleaseC
1.10.2

Function introduced in this release.

--- Last Modified: March 16, 2018 | 11:54 AM