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

__ns_fopen64_special(3) Guardian Native C Library Calls Reference Manual
If a device does not support the sync-id mechanism and a sync_depth value is specified, a value
of 1 (one) is used for sync_depth.
If you include a system name in the filename, you must precede the system name with two
backslashes instead of one because backslash is an escape character in C. For example, to open
the file \SYS.$VOL.SVOL.FILE, you would use the C string: "\\SYS.$VOL.SVOL.FILE".
If the file does not already exist and you include "b" in the access string,
__ns_fopen64_special() creates a C binary file. Otherwise, __ns_fopen64_special( ) creates an
Edit file.
If the file exists and you include "b" in the access string, __ns_fopen64_special( ) opens the file
as a C binary file. Otherwise, __ns_fopen64_special( ) opens the file as a text file.
The default number of secondary extents for files created by __ns_fopen64_special() is 16. The
default number of maxextents for files created by __ns_fopen64_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_fopen64_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). For details, see the C/C++ Programmer’s Guide.
532 Hewlett-Packard Company 527192-018