$NEWPASS and $OLDPASS are specialized disc ￿les with man y similarities to other disc ￿les, but with some di￿erences. F or example, the default close disposition of $NEWPASS includes renaming it. For detailed comparisons of $NEWPASS to new ￿les and $OLDPASS to old ￿les refer to Accessing Files Pr ogrammer's Guide (32650-90017).

Searching File Directories

There are two directories with addresses of ￿les: Job T emporary File Directory for the addresses of TEMP ￿les, and System File Directory for the addresses of PERMANENT ￿les.

There is no directory for NEW ￿les. When a ￿le is opened, the File System ma y search both directories, depending on the ￿le domain options speci￿ed, starting with the Job T emporary File Directory, until it ￿nds the ￿le address associated with the ￿le.

Finding FilesYou can use the the follo wing commands to see ￿le and ￿le equation lists:

:LISTFILE command for PERMANENT ￿les :LISTFTEMP command for TEMP ￿les

:LISTEQ command for curren t ￿le equations

For a detailed description of the commands, refer to Getting System Information Programmer's Guide (32650-90018).

Types of Operations Allowed on Files

The types of operations most frequen tly used on a ￿le involve reading, writing, sa ving, appending, information to the end of a ￿le, updating a ￿le, and v arious combinations of operations. The t ype of operation allo wed is determined when a ￿le is opened. Y ou can override the operations allo wed by system defaults with speci￿cations in y our program or the :FILE command. The type of operation is not a permanen t characteristic of a disc ￿le, so it is not in the ￿le label. Th us, no overriding can tak e place at this level, although the physical characteristics of a device ￿le ma y dictate the types of operations allo wed. For example, a line printer is always a write-only ￿le, and a real operation cannot be speci￿ed for it.

Physical characteristics of a ￿le cannot be c hanged after it has been created. Th us it is logical for the ￿le label to tak e precedence over all commands. Other determinan ts are e￿ective only when a new ￿le is being created.

Note

:FILE commands, HPFOPEN calls, and FOPEN calls cannot alter ph ysical

 

characteristics of an existing ￿le.

 

 

Opening a File

Before a process can read, write, or manipulate a ￿le, it m ust initiate access to the ￿le b y opening it with the HPFOPEN or FOPEN intrinsic call. This call applies to all disc and device ￿les. When HPFOPEN or FOPEN is executed, it returns a ￿le n umber used to identify the ￿le in subsequent intrinsic calls issued b y the process.

If the ￿le is successfully opened, the ￿le n umber returned is a positive in teger. If the ￿le cannot be opened, the ￿le n umber returned is zero (0).

6-16 File System