Guardian Native C Library Calls Reference Manual (G06.28+, H06.05+)
Guardian Native C Library Calls (f) freopen_guardian(3)
NAME
freopen_guardian - Opens a stream (Guardian freopen( ) 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 ∗∗freopen(
const char ∗∗filename,
const char ∗∗mode,
FILE ∗∗stream);
FILE ∗∗freopen_guardian(
const char ∗∗filename,
const char ∗∗mode,
FILE ∗∗stream);
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).
stream Specifies the input stream.
DESCRIPTION
The freopen() Guardian function and freopen_guardian() function substitute the named file in
place of the open stream.
These functions are identical in the Guardian environment. Unless otherwise noted, this refer-
ence page uses freopen( ) to refer to both the freopen( ) Guardian function and
freopen_guardian() function.
The freopen() function returns a pointer to the FILE structure associated with the stream param-
eter. The freopen( ) function is typically used to attach the preopened streams associated with
stdin, stdout, and stderr to other files.
The mode parameter controls the access allowed to the stream. It can have one of these 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).
527192-007 Hewlett-Packard Company 2−81