Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (e - f) fopen_guardian(3)
NAME
fopen_guardian - Opens a stream (Guardian fopen( ) function)
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRTLSRL
G-series native OSS processes: /G/system/sysnn/zcrtlsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcrtldll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycrtldll
SYNOPSIS
#include <stdio.h>
FILE fopen(
const char filename,
const char mode);
FILE fopen_guardian(
const char filename,
const char mode);
PARAMETERS
filename Points to a character string that contains the name of the file to be opened. To
include a node name in the filename, precede the node name with two
backslashes (\\) instead of one because backslash is an escape character in C.
mode Points to a character string that controls whether the file is opened for reading
(r), writing (w), or appending (a) and whether the file is opened for updating (+).
The character string also controls whether the file is a text file (default) or a
binary file (b).
DESCRIPTION
The fopen( ) Guardian function and fopen_guardian( ) function open the file named by the
filename parameter and associate a stream with it, returning a pointer to the FILE structure of
this stream.
These functions are identical in the Guardian environment. Unless otherwise noted, this refer-
ence page uses fopen( ) to refer to both the fopen( ) Guardian function and fopen_guardian( )
function.
The mode parameter controls the access allowed to the stream. It can have one of the following
values:
r Opens a text file for reading.
w Creates a new text file for writing, or opens and truncates a text file to zero
length.
a Appends (opens a text file for writing at the end of the file, or creates a text file
for writing).
r+ Opens a text file for update (reading and writing).
w+ Truncates or creates a text file for update.
a+ Appends (opens a text file for update, writing at the end of the file, or creates a
text file for writing).
527187-017 Hewlett-Packard Company 2113