PROCEDURE rap$get_file_ring_attributes (
  file_name, fn: file = $required
  ring, r: (VAR) array 1..3 of integer = $required
  status)

*IF $variable(rav$proc_doc,declared)<>'UNKNOWN'
"
"  This procedure gets the ring attributes of a file and places
"  them in a variable array parameter as separate integer values.
"  Array position 1 is R1, position 2 is R2, and position 3 is R3.
"
*IFEND


  VAR
    local_status: status
    file_attributes: list of any
  VAREND



*IF $variable(rav$proc_doc,declared)<>'UNKNOWN'
"
"  The following IF check is performed because the function $FILE_ATTRIBUTES
"  cannot return a bad status if the file does not exist.
"
*IFEND


  file_attributes = $file_attributes(file_name (registered, ring_attributes))
  IF NOT file_attributes(1).registered THEN
    local_status = $status(FALSE, 'PF', pfe$unknown_permanent_file, $string(file_name))
  ELSE
    ring(1) = file_attributes(1).ring_attributes.r1
    ring(2) = file_attributes(1).ring_attributes.r2
    ring(3) = file_attributes(1).ring_attributes.r3
  IFEND

  EXIT procedure WITH local_status WHEN NOT local_status.normal

PROCEND rap$get_file_ring_attributes
