Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-137
open (supplementary)
open (supplementary)
The open function opens a file for alternate I/O.
file_name
points to a string containing a valid Guardian file name.
flags
is an integer value specifying the attributes of the file. Possible attribute values are
described under “Usage Guidelines.
security
specifies the security setting. See the FUP SECURE command description of integer
encoding in the FUP Reference Manual for more information.
depth
is analogous to the sync-or-receive-depth parameter of the FILE_OPEN_ system
procedure. See the Guardian Procedure Calls Reference Manual for more
information. If you do not specify depth, then open uses the value 1.
pext
specifies the number of pages (2048-byte blocks) in the primary extent; it must be in
the range 1 through 65,535. If you omit pext, then open uses the value 2.
sext
specifies the number of pages in each of the secondary extents; it must be in the
range 1 through 65,535. If you omit sext, then open uses the value 4.
Return Value
is a descriptor denoting the newly opened file if the operation is successful or -1 if
an error occurs.
#include <fcntlh>
int open(char *file_name, int flags, [int security],
[int depth], [int pext], [int sext]);