DSC Tech Library
FASTPLUS C Library
Function fpfile_open opens a FASTPLUS file from within an application program. The user
can specify whether the file is to be opened for exclusive access or shared access, and
whether the file is to be opened with update or inquiry privileges.
A function flag is passed to fpfile_open requesting shared or exclusive access
capability. With shared access rights, the process may open a file along with many other
processes. However, if another process has already opened the file with exclusive access
rights, any attempt to open the file with either access rights and another process has the
file open with shared access rights, an error will also result.
fpfile_open insures that the FASTPLUS shared memory tables are properly
initialized and that the FASTPLUS routines are properly addressing these tables. If
fpfile_open determines that there is a problem with the shared tables, an error message
will be displayed.
fpfile_open returns the unit (file_id) that the file is open on. This
will be needed for future calls to other FASTPLUS functions.
The syntax for fpfile_open is as follows:
fpfile_open(char *name, int flags)
char *name - File pathname. null terminated pointer.
int flags - Bitmapped flag indicating the type of open desired.
1 (FPOREAD) - open for read only
2 (FPOWRIT) - open for writing only
3 (FPORDWR) - open for read/write
4 (FPOEXCL) - open for exclusive access - bypasses record and
node based concurrency checks
5 (FPONOREM) - do not open file if it is not local
NOTE: Access privileges for the file on disk should be set to allow
read/write activity. fpfile_open will handle the file access based on the type of file
The possible values for fperrno and an explanation of each value follow.
FEROK - Code 0: Successful FASTPLUS Operation
FERFYP - Code 1: Not a FAST file
FERACC - Code 2: Illegal access rights
FERCTL - Code 3: FAST file Node Does not exist
FERMAX - Code 14: Too many FAST files open
FERMXU - Code 21: Illegal user number
FERREM - Code 30: Remote access denied
FCENKY - Code 34: Illegal number of keys
FERNSV - Code 43: No servers started