CRE Programmer's Guide

CRE Service Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
6-15
CRE_File_Open_
The device type for standard output and standard log must be a process, the
operator console, a disk, a printer, or a terminal.
If you specify different values for the
exclusion, sync_receive_depth, or
options parameters on any open after the first open, the CRE returns an error
stating that the requested attributes are incompatible with existing attributes,
unless the requested attributes are a subset of the existing attributes.
File connections
For each standard file, the CRE opens a file one time, regardless of how many
times your program opens that standard file. The CRE grants a connection to the
file to each caller of CRE_File_Open_ that specifies the same standard file—
standard input, standard output, or standard log. Because CRE_File_Open_ grants
a connection to the same open of the file to each caller, each reference to the file
reads or writes, as appropriate, to the same file.
Under some circumstances, the CRE does not open a physical file. The CRE does,
however, grant connections to the standard file, even though it does not open a
file.
Figure 6-1
on page 6-16 shows how the CRE manages connections to standard
files. As shown in the figure, CRE_File_Open_ searches its I/O file table for an
entry that corresponds to the standard file that you are opening. If an entry exists,
CRE_File_Open_ grants the caller a connection to the file. Otherwise,
CRE_File_Open_ calls the FILE_OPEN_ system procedure to open the file.
See Section 2, CRE Services
, for a full description of how the CRE determines the
name of the file to open for each standard file.
Accessing standard files
Use the standard constructs of the languages in which you write your routines to
access standard files. Table 6-3
on page 6-16 shows examples of how your
program accesses the standard files supported by the CRE. For more information,
see the reference manuals for the languages in which your routines are written.