Accessing Files Programmer's Guide (32650-90885)

48 Chapter2
Creating A File
The FOPEN Intrinsic
The FOPEN Intrinsic
The FOPEN intrinsic is the other programmatic interface for supplying the file system with
information about your file. Its syntax is:
filenum
:= FOPEN (
formaldesignator
,
foptions
,
aoptions
,
recsize
,
device
,
formmsg
,
userlabels
,
blockfactor
,
numbuffers
,
filesize
,
numextents
,
initialloc
,
filecode
);
The following table shows the correspondence between the optional parameters of FOPEN
and HPFOPEN that you can use to specify a file's physical characteristic at file creation. For
more details on using the FOPEN intrinsic, refer to the MPE/iX Intrinsics Reference
Manual.
Table 2-1. FOPEN/HPFOPEN Parameter Equivalents
FOPEN Parameter HPFOPEN Itemnum,Item
filenum
(functional return)
filenum
(parameter)
formaldesig 2, formaldesig
foption:
Bits (14:2) domain
Bit (13:1) ASCII/binary
Bits (10:3) file designator
Bits (8:2) record format
Bit (7:1) carriage-control
Bit (6:1) labeled tape
Bit (5:1) disallow file equation
Bits (2:3) file type
3, domain
53, ASCII/binary
5, file designator
6, record format
7, carriage-control
8, labeled tape
9, disallow file equation
10, file type
aoption:
Bits (12:4) access type
Bit (11:1) multirecord
Bit (10:1) dynamic locking
Bits (8:2) exclusive
Bit (7:1) inhibit buffering
Bits (5:2) multiaccess mode
Bit (4:1) nowait I/O
Bit (3:1) file copy
11, access type
15, multirecord
12, dynamic locking
13, exclusive
46, inhibit buffering
14, multiaccess mode
16, nowait I/O
17, file copy
recsize 19, record size