The LISTFILE, LISTFILE...;TEMP and LISTEQ commands
return formatted information to your
job or session list device. If you need to retrieve specific information
about a particular file, and you wish to place it in a variable
available either to your CI or to your program, then you'll be interested
in the the CI evaluator function and intrinsics described below.
You can use the FINFO evaluator function interactively to
retrieve information about a specified file. FINFO is a function
of the expression evaluator, a system procedure used by the IF, WHILE,
SETVAR, and CALC commands of the command interpreter.
FINFO has two parameters. The first is the file name of the
file about which you wish to obtain information; this is a string,
and must be either a fully or partially qualified file name, or
a FILE equation backreference. The second parameter is
an integer or integer expression that indicates the nature of the
information required. The options available are listed in
Table 14-2 "FINFO Options"Table 14-2 FINFO Options
Specify:
FINFO returns:
0
True if rhw file exists; False if it does not
1
Fully qualified file designator
4
Name of file creator
6
Date of file creation in format (day,mmm,dd,yyyy)
-6
Date of file creation in format (yyyymmdd)
8
Date of last modification in format (day,mmm,dd,yyyy)
-8
Date of last modification in format (yyyymmdd)
9
File code mnemonic or file code as string
-9
File code as integer
12
File limit
13
FOPTIONS (same format as LISTFILE -3)
-13
FOPTIONS
14
Record size (negative value indicates bytes)
15
Block size
19
EOF marker location
24
Last modified time in format (hh:mm am/pm)
-24
Last modified time in format (hhmmss)
33
Lockword
For a more complete list of items that FINFO supports, type HELP FINFO at your
terminal.
The example below shows the steps you can use to retrieve
the following information about a file:
the fully qualified file designator of the specified file
the name of the file creator
file characteristics, returned in the decimal, hexadecimal, and
octal equivalents of the foptions format described in
the FOPEN intrinsic description located in the MPE/iX
Intrinsics Reference Manual.
the file code, returned in decimal, hexadecimal,
and octal equivalents
Use this intrinsic to retrieve information about a specified file. The file can
be on any device, but it must be opened by the calling process at the time of
the FFILEINFO call. If you wish to return label information from a
file that is not opened, use FLABELINFO instead. FFILEINFO
has one required parameter, filenum. This is the file number,
which is returned when you open a file using FOPEN or
HPFOPEN. You can specify the information that you wish to be returned
by using up to five itemnum,item pairs. Each
itemnum designates a type of information (for example, logical
device number, name of file creator, or volume ID), which is then returned in
the item parameter. The itemnums can be
specified in any order.
Here is an example of an FFILEINFO intrinsic call. The information
returned in this example is the same information retrieved in theFINFO
example above:
This intrinsic, which returns some of the same information as
FFILEINFO, is an MPE V/E-based intrinsic that is currently supported
only for compatibility reasons. When you use a call to FGETINFO,
MPE/iX now calls FFILEINFO to retrieve the file information. For this
reason, it is advisable for you to call FFILEINFO directly; however,
there is no need to rewrite existing programs that use FGETINFO unless
there is a performance problem.
Here is an example of an FGETINFO intrinsic call that is the exact
equivalent of the FFILEINFO example shown above:
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.
Displaying General File Information
Determining Interactive/Duplicative Files with FRELATE