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

freopen_oss(3) Guardian Native C Library Calls Reference Manual
NAME
freopen_oss - Opens a stream (OSS 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 path,
const char mode,
FILE stream);
FILE freopen_oss(
const char path,
const char mode,
FILE stream);
PARAMETERS
path Points to a character string that contains the name of the le to be opened. If the
nal component of the path parameter species a symbolic link, the link is
traversed and pathname resolution continues.
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 (+).
stream Species the input stream.
DESCRIPTION
The freopen() OSS function and freopen_oss() function substitute the named le in place of the
open stream.
These functions are identical in the OSS environment. Unless otherwise noted, this reference
page uses freopen() to refer to both the freopen( ) OSS function and freopen_oss() function.
The original stream is closed regardless of whether the open() function succeeds with the named
le. The freopen() function returns a pointer to the FILE structure associated with the stream
parameter. The freopen( ) function is typically used to attach the preopened streams associated
with stdin, stdout, and stderr to other les.
The mode parameter controls the access allowed to the stream. It can have one of the following
values:
r Opens the le for reading.
w Creates a new le for writing, or opens and truncates a le to zero length.
a Appends (opens a le for writing at the end of the le, or creates a le for writ-
ing).
r+ Opens a le for update (reading and writing).
262 Hewlett-Packard Company 527192-005