Accessing Files Programmer's Guide (32650-90885)

64 Chapter2
Creating A File
Specifying a File Code
Specifying a File Code
MPE/iX subsystems often create special-purpose files whose functions are identified by
four-digit integers called file codes, written in their system file labels. HPFOPEN/FOPEN,
BUILD, and FILE have parameters that enable you to specify a file code for your file when
you first create it. For user files, you can use as a file code any number from 0 through
1023. Numbers above 1023 listed in Table 2-6. on page 64 are predefined by
Hewlett-Packard for special system files and should not be redefined for your use. If you do
not specify a file code when you create a file, the MPE/iX default value of zero applies.
For instance, compilers create Native Mode Object (NMOBJ) files, written in a special
format and identified by the code 1461, upon which they compile object programs. User
programs sometimes create files that must be identified in some unique way, too. Such a
program might produce a permanent disk file identified by the integer 1. If you were to run
this program several times and want to uniquely identify the file produced on each run (or
set of runs) by a special class, purpose, or function, you could use a FILE command to
supply a unique file code for each run (or group of runs).
For instance, on the second run, you might wish to classify the file with the file code 2, as
follows:
File code
|
FILE DESGX=DESGB;CODE=2
RUN FILEPROD
If you later wished to determine the classification to which this file belonged, you could use
the LISTFILE command with an information level of 1, which prints the file name, file
code, and other information about the file. Alternatively, you could determine the file code
by calling the FFILEINFO intrinsic. Both LISTFILE and FFILEINFO are discussed in Getting
System Information Programmer's Guide. The file codes that have particular
Hewlett-Packard-defined meanings are listed in Table 2-6. on page 64
Table 2-6. Reserved File Codes
Integer Mnemonic Meaning
1024 USL User Subprogram Library
1025 BASD Basic Data
1026 BASP Basic Program
1027 BASFP Basic Fast Program
1028 RL Compatibility Mode Relocatable Library
1029 PROG Compatibility Mode Program File
1031 SL Segmented Library
1035 VFORM VPLUS Forms File