FOPEN Routine in MPE and UNIX

Both MPE and UNIX have routines named FOPEN
and FCLOSE which open and close files.
The MPE versions are more complex, since the MPE file
system is more complex (it has record types and sizes,
user labels, etc.). On UNIX a file is just a stream of bytes.
In fact, MPE has superseded FOPEN with the even more complex
HPFOPEN routine.

The Foptions value is a 16-bit unsigned integer made up
of 1, 2 and 3-bit fields. The 1-bit fields have value 1
to enable the option. Most fields default to the 0 value.
Remember that MPE
numbers bit fields
as (startbit:bitcount) and leftmost bit is 0:

The Aoptions value is a 16-bit unsigned integer made up
of 1 to 4-bit fields. The 1-bit fields have value 1
to enable the option. Most fields default to the 0 value.
Remember that MPE
numbers bit fields
as (startbit:bitcount) and leftmost bit is 0:

When HP needed new parameters and options for opening files,
they added a new intrinsic to MPE: HPFOPEN. It accepts a
variable number of
pairs of parameters, the first of which is an Itemnum
and the second is the Item_Value.

A few important things to remember:
the status is actually decoded as
two 16-bit values, Itemnum 2 the file name must
have an opening "quote" that also appears at the end,
you can open a new file and save it at the same time, and
you can open a file with mapped access.

The MPE FCONTROL intrinsic and the UNIX fcntl function both
provide control over open files, but are otherwise dissimilar.
The terminal control functions of FCONTROL, such as control code 12
to turn Echo on, are not part of fcntl; see stty, termio,
and ioctl instead.
The file lock functions of fctnl are provided by the FLOCK and
FUNLOCK intrinsics of MPE, if at all.
The undocumented control codes 31 and 30 of FCONTROL (Vplus Block mode On
and Off) are incorporated into the blmode functions of HP-UX.