File Designators

A ￿le designator is a name used b y the File System to reference a ￿le with great ￿exibility . It allows you to equate a name other than the ￿le name used in the standard ￿le reference format, described belo w.

The two types of MPE/iX ￿le designators are: Formal ￿le designator Actual ￿le designator

A formal ￿le designator is the name b y which a program recognizes a ￿le. It is speci￿ed programmatically or in a ￿le equation and is not the ￿le name found in the ￿le list of a directory. It is the ￿le name coded in to the program, along with the program's speci￿cations for the ￿le. The :FILE command refers to a ￿le b y its formal ￿le designator. A formal ￿le designator is frequen tly called a user ￿le name.

An actual ￿le designator is a ￿le name pro vided by the user for the File System to use in place of the formal ￿le designator to accomplish a task. In man y cases, the formal ￿le designator and the actual ￿le designator are the same. The actual ￿le designator is the ￿le name giv en in the ￿le list of a directory . It is described in the standard ￿le reference format:

filename [/lockword][.groupname][.accountname]

To read from an input ￿le, a program requires that a name for the ￿le m ust be speci￿ed in the program. Ho wever, it is desirable to allo w a user at run time to pro vide a ￿le of any name to be used for this purpose. This is accomplished b y using ￿le designators to associate the ￿le name the user pro vides with the ￿le name the program expects. Programmers can use an arbitrary name as a formal ￿le designator and equate it to an appropriate actual ￿le designator at run time, a tec hnique facilitating maximum ￿le reference ￿exibility . When used in this way, the formal ￿le designator con tains one to eigh t alphanumeric characters, beginning with a letter.

Note

HPFOPEN option (Item #38), the ￿le privilege option , when used to set a

 

NEW ￿le's privilege lev el to other than three (least-privileged, of user lev el),

 

disallows all subsequen t access to that ￿le b y the FOPEN intrinsic. (For

 

compatibility reasons, FOPEN can access only a ￿le whose ￿le privilege lev el is

 

three.)

 

 

The formal ￿le designator is the name passed to the HPFOPEN or FOPEN intrinsic and used when HPFOPEN or FOPEN looks for a ￿le equation for that ￿le. When users in voke a :FILE command, they can specify a ￿le name to equate to the formal ￿le designator. This ￿le name is the actual ￿le designator. A t run time, the program will ￿nd the actual ￿le designator associated with the formal ￿le designator and open the user-speci￿ed ￿le. Figure 6-4 sho ws an example of using ￿le designators. In this example, the ￿le directory on disc sho ws an actual ￿le designator PAYROLL5 and the REPORT program contains a formal ￿le designator named PAYROLLX . At run time, a user can use the :FILE command to create a ￿le equation associating the name PAYROLLX with the name PAYROLL5 . When the user runs the REPORT program, it uses the con tent of the PAYROLL5 ￿le wherever it performs an operation on

PAYROLLX .

File System 6-9