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

__ns_fopen_special(3) Guardian Native C Library Calls Reference Manual
Access Mode Values
The possible values of the string access_mode are:
r Open an existing text le for read-only access.
w Create a text le (or truncate an existing text le to length zero) and open it for
write-only access.
a Create a text le (or open an existing text le) and open it for append (write at
the end of the le) access.
r+ Open an existing text le for update access (reading and writing).
w+ Create a text le (or truncate an existing text le to length zero) and open it for
update access.
a+ Create a text le (or open an existing text le) and open it for update access with
writing at the end of the le.
rb Open an existing binary le for read-only access.
wb Create a binary le (or truncate an existing binary le to length zero) and open it
for write-only access.
ab Create a binary le (or open an existing binary le) and open it for append (write
at the end of the le) access.
rb+ Open an existing binary le for update access (reading and writing).
wb+ Create a binary le (or truncate an existing binary le to length zero) and open it
for update access.
ab+ Create a binary le (or open an existing binary le) and open it for update access
with writing at the end of the le.
If you attempt to open a le in read mode and the le does not exist or cannot be read,
__ns_fopen_special() fails, returning the pointer value NULL.
When you open a le in append mode, the le-position indicator is set to the end of the le
before each write operation, regardless of previous positioning.
The ANSISTREAMS pragma determines whether a text le is type 180 (C binary le) or type
101 (edit le). Refer to the C/C++ Programmers Guide for details.
RETURN VALUES
Upon successful completion, a pointer to the FILE structure denoting the open le is returned.
Otherwise, a NULL pointer is returned.
ERRORS
If any of the following conditions occur, the __ns_fopen_special() function sets errno to the
corresponding value:
[ENOIMEM] Insufcient memory is available.
[EINVAL] An invalid argument is specied.
fopen() function errno value
An error occurred on the le open.
514 Hewlett-Packard Company 527192-005