Accessing Files Programmer's Guide (32650-90885)

Chapter 14 197
Getting File Information
Determining Interactive/Duplicative Files with FRELATE
FLABELINFO
The FLABELINFO intrinsic returns information from the file label of a disk file. The file need
not be opened at the time of the intrinsic call. The information returned by this intrinsic is
a subset of the information returned by FFILEINFO.
Here is an example of a FLABELINFO intrinsic call that returns the same information as the
FFILEINFO and FGETINFO examples shown above:
FORMALDESIGNATOR:='MYFILE.MYGROUP.MYACCT ';
MODE:=0;
FSERRORCODE:=0;
ITEMNUMS[1]:=13; {Bytes 1..2 return characteristics }
ITEMNUMS[2]:=9; {Bytes 3..4 return file code }
ITEMNUMS[3]:=1; {Bytes 5..12 return file name }
ITEMNUMS[4]:=2; {Bytes 13..20 return group name }
ITEMNUMS[5]:=3; {Bytes 21..28 return account name }
ITEMNUMS[6]:=4; {Bytes 29..36 return creator name }
ITEMNUMS[7]:=0; {Zero indicates end of list }
INITIALIZE_ITEMS; {Procedure initializes ITEMS fields}
INITIALIZE_ITEMERRORS; {Procedure sets elements to zero }
FLABELINFO(FORMALDESIGNATOR,MODE,
FSERRORCODE,ITEMNUMS,ITEMS,ITEMERRORS);
The ITEMS parameter above is a record structure, exactly 36 bytes in length, that can be
declared in the following manner:
TYPE ITEMS_TYPE = RECORD
FOPTIONS: 0..65565; {2-byte unsigned integer}
FILECODE: SHORTINT; {2-byte signed integer }
FILENAME: PACKED ARRAY[1..8] OF CHAR;
GROUPNAME: PACKED ARRAY[1..8] OF CHAR;
ACCOUNTNAME: PACKED ARRAY[1..8] OF CHAR;
CREATORNAME: PACKED ARRAY[1..8] OF CHAR;
END;
A complete description of the information that you can obtain using FLABELINFO is given
in the MPE/iX Intrinsics Reference Manual.
Determining Interactive/Duplicative Files with FRELATE
This intrinsic is used for one specific purpose: determining whether a pair of files (input
file and list file) is interactive, duplicative, or both. Interactive means that the file
requires human intervention for all input operations. For example, an input file and a list
file opened to the same terminal would form an interactive pair. Duplicative means that
all input to the input file is echoed automatically to the list file. For example, input to a
keyboard is duplicated on the associated CRT.
The FRELATE intrinsic has two required parameters:
infilenum
is the file number of the
input file, and
listfilenum
is the file number of the list file. Both of these numbers are
returned when you create the files using HPFOPEN or FOPEN.