?? RIGHT := 110 ??
?? NEWTITLE := 'INSTALL_SOFTWARE Utility: RAP$SET_FILE_RETENTION Interface.' ??
MODULE ram$set_file_retention;

{ PURPOSE:
{   This module contains the interface that sets the retention period
{   for a file.
{
{ DESIGN:
{   The compiled module resides in RAF$LIBRARY.
{
{ NOTES:
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc fst$file_reference
?? POP ??
*copyc clp$trimmed_string_size
*copyc pfp$change
*copyc pfp$convert_fs_path_to_pf_path
*copyc pfp$convert_string_to_fs_path
?? OLDTITLE ??
?? NEWTITLE := '[XDCL] rap$set_file_retention', EJECT ??

{ PURPOSE:
{   This interface sets the retention period for a file.
{
{ DESIGN:
{   The file is first converted from FS format to PF format so that the
{   interface that sets the retention period can be called.
{
{ NOTES:
{


  PROCEDURE [XDCL] rap$set_file_retention
    (    file: fst$file_reference;
         retention_period: pft$retention;
     VAR status: ost$status);


    CONST
      no_password = '                               ';

    VAR
      cycle_reference: fst$cycle_reference,
      cycle_selector: clt$cycle_selector,
      fs_path: string (fsc$max_path_size),
      ignore_open_position: fst$open_position,
      ignore_password: pft$password,
      new_retention_period: array [1 .. 1] of pft$change_descriptor,
      number_of_path_elements: fst$number_of_path_elements,
      pf_path_p: ^pft$path;


    status.normal := TRUE;

{ Convert the file path, which is in FS format to PF format.

    pfp$convert_string_to_fs_path (file, fs_path, number_of_path_elements, cycle_reference,
          ignore_open_position, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH pf_path_p: [1 .. number_of_path_elements];

    pfp$convert_fs_path_to_pf_path (fs_path, pf_path_p, cycle_reference, cycle_selector, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

{ Set the retention period for the file.

    new_retention_period [1].change_type := pfc$retention_change;
    new_retention_period [1].retention := retention_period;

    pfp$change (pf_path_p^, cycle_selector.value, no_password, new_retention_period, status);

  PROCEND rap$set_file_retention;
MODEND ram$set_file_retention;
