Guardian Native C Library Calls Reference Manual (G06.28+, H06.04+)

Guardian Native C Library Calls (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 native Guardian processes: $SYSTEM.ZDLLnnn.ZCRTLDLL
H-series OSS processes: /G/system/zdllnnn/zcrtldll
SYNOPSIS
#include <stdio.h>
FILE fopen(
const char lename,
const char mode);
FILE fopen_guardian(
const char lename,
const char mode);
PARAMETERS
filename Points to a character string that contains the name of the le to be opened. To
include a node name in the lename, 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 le is opened for reading
(r), writing (w), or appending (a) and whether the le is opened for updating (+).
The character string also controls whether the le is a text le (default) or a
binary le (b).
DESCRIPTION
The fopen( ) Guardian function and fopen_guardian() function open the le named by the
lename 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 le for reading.
w Creates a new text le for writing, or opens and truncates a text le to zero
length.
a Appends (opens a text le for writing at the end of the le, or creates a text le
for writing).
r+ Opens a text le for update (reading and writing).
w+ Truncates or creates a text le for update.
a+ Appends (opens a text le for update, writing at the end of the le, or creates a
text le for writing).
527192-005 Hewlett-Packard Company 227