Note

When you specify a ￿le domain using HPFOPEN , you should open only disc

 

￿les with the domain option set to NEW. Device ￿les can be opened with the

 

domain option set to NEW (to maintain compatibility with MPE V/E), but a

 

warning is returned in the status parameter.

 

 

NEW Files

When you create a ￿le, you can indicate to the File System that it is a NEW ￿le; it did not previously exist. Space for this ￿le has not y et been allocated. As a NEW ￿le, only the program that creates it kno ws about it, and it exists only while the program is executing. When the program concludes, the ￿le v anishes, unless y ou take action to retain it.

TEMP Files

A TEMP ￿le is one that already exists, but only the job or session that created it kno ws about it. Some or all of the space for the ￿le has been allocated, and its ph ysical characteristics ha ve been de￿ned. A ￿le in this domain is a job temporary ￿le; it has been created for a speci￿c purpose by its job or session. It ma y not be needed after the job or session ends. When the job or session concludes, the ￿le automatically disappears, unless y ou take action to change it to a PERMANENT ￿le. This is described in the \Changing Domains" subsection, belo w.

PERMANENT Files

A PERMANENT ￿le exists as a permanen t ￿le in the File System. Its existence is not limited to the duration of its creating job or session. An y job or session can access the ￿le when securit y restrictions allo w. Some or all of the space for the ￿le has been allocated, and its ph ysical characteristics ha ve been de￿ned. When the job or session concludes, the ￿le remains.

Effect of File Domain on Operations

You can select or change the domain disposition of a ￿le when y ou close the ￿le using the FCLOSE intrinsic. This is called the closing disposition of the ￿le and follo ws these rules:

Any ￿le can be deleted when closed. This is the default for a NEW ￿le. A NEW ￿le can be changed to a TEMP ￿le when closed. A NEW or TEMP ￿le can be changed to PERMANENT when closed.

A PERMANENT ￿le can be changed to a TEMP when closed by a PM (privileged mode) user.

The File System action defaults to delete a NEW ￿le, temporarily k eep a TEMP ￿le, and save a PERMANENT ￿le. The way in which subsystems use ￿les a￿ects these defaults. Y ou can specify a closing disposition with a :FILE command that overrides how the program or subsystem closes the ￿le. Other commands suc h as :PURGE , :BUILD , and :SAVE provide various mechanisms for changing ￿le domain. F or detailed information on these commands, refer to the MPE/iX Commands Reference Manual Volumes 1 and 2 (32650-90003 and 32650-90364).

The FCLOSE intrinsic is called for ev ery ￿le on which an HPFOPEN or FOPEN has been performed. The File System ensures that an opened ￿le is automatically closed at program termination, without requiring an explicit statemen t. However, a subsystem m ust explicitly call FCLOSE to ensure that the action tak en will be as speci￿ed in y our program.

Determining ￿le disposition at close time can ha ve consequences on running programs (especially in batc h mode). For example, a program can open a NEW ￿le by default, write data

File System 6-7