The construct_version method

An element construct_version method is invoked when standard software on Linux and the UNIX system reads a particular version of the element (unless the contents are already cached in a cleartext storage pool). For example, the construct_version method of element monet_admin.1 is invoked by the view_server when a user enters these commands:

% cp monet_admin.1 /usr/tmp
(read version selected by view)
% cat monet_admin.1@@/main/4
(read a specified version)

The construct_version method is also invoked during a checkout command, which makes a view-private copy of the most recent version on a branch.

The construct_version method of the z_whole_copy type manager does the following operations:
  1. Uncompresses the contents of the data container
  2. Returns to the calling process an exit status that indicates what to do with the new data container

The file ccase-home-dir/lib/mgrs/mgr_info.h lists the arguments passed to the method.

/**********************************************************************
******
 * construct_version
 * Fetch the data for a version.
 * Extract the data for the requested version into the supplied path, or
 * return a value indicating that the source container can be used as the
 * cleartext data for the version.
 *
 * Command line:
 *  construct_version source_container_pname data_pname version_oid

The file ccase-home-dir/lib/mgrs/mgr_info.sh lists the appropriate exit statuses and provides a symbolic name for the construct_version method:

# Any unexpected value is treated as failure
MGR_FAILED=1

# Return Values for construct operations
MGR_CONSTRUCT_USE_SRC_CONTAINER=101
MGR_CONSTRUCT_USE_NEW_FILE=102
 .
 .
MGR_OP_CONSTRUCT_VERSION="construct_version"

This example code in the source code of the construct_version method implements the construct_version method.