Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

Guardian Native C Library Calls (n - r) __ns_fopen_special(3)
The default number of secondary extents for files created by __ns_fopen_special() is 16. The
default number of maxextents for files created by __ns_fopen_special() is 500.
For complete details on active backup programming in C, see the Guardian Programmer’s
Guide.
Access Mode Values
The possible values of the string access_mode are:
r Open an existing text file for read-only access.
w Create a text file (or truncate an existing text file to length zero) and open it for
write-only access.
a Create a text file (or open an existing text file) and open it for append (write at
the end of the file) access.
r+ Open an existing text file for update access (reading and writing).
w+ Create a text file (or truncate an existing text file to length zero) and open it for
update access.
a+ Create a text file (or open an existing text file) and open it for update access with
writing at the end of the file.
rb Open an existing binary file for read-only access.
wb Create a binary file (or truncate an existing binary file to length zero) and open it
for write-only access.
ab Create a binary file (or open an existing binary file) and open it for append (write
at the end of the le) access.
rb+ Open an existing binary file for update access (reading and writing).
wb+ Create a binary file (or truncate an existing binary file to length zero) and open it
for update access.
ab+ Create a binary file (or open an existing binary file) and open it for update access
with writing at the end of the file.
If you attempt to open a file in read mode and the file does not exist or cannot be read,
__ns_fopen_special() fails, returning the pointer value NULL.
When you open a file in append mode, the file-position indicator is set to the end of the file
before each write operation, regardless of previous positioning.
The ANSISTREAMS pragma determines whether a text file is type 180 (C binary file) or type
101 (edit file). Refer to the C/C++ Programmer’s Guide for details.
RETURN VALUES
Upon successful completion, a pointer to the FILE structure denoting the open file 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.
527192-018 Hewlett-Packard Company 535