Sun Java System Web Server 7.0 Update 4 NSAPI Developer's Guide

fc_open() Function

The fc_open function returns a pointer to PRFileDesc that refers to an open file (fileName). The fileName must be the full path name of an existing file. The file is opened in read mode only. The application calling this function should not modify the currency of the file pointed to by the PRFileDesc * unless the DUP_FILE_DESC is also passed to this function. In other words, the application at minimum should not issue a read operation based on this pointer that would modify the currency for the PRFileDesc *. If a read operation is required, that might change the currency for the PRFileDesc *, then the application should call this function with the argument DUP_FILE_DESC.

On a successful call to this function, a valid pointer to PRFileDesc is returned and the handle FcHdl is properly initialized. The size information for the file is stored in the fileSize member of the handle.

Syntax

PRFileDesc *fc_open(const char *fileName, FcHdl *hDl,
                    PRUint32 flags, Session *sn, Request *rq);

Return Values

Pointer to PRFileDesc, or NULL on failure.

Parameters

const char *fileName is the full path name of the file to be opened.

FcHdl*hDl is a valid pointer to a structure of type FcHdl.

PRUint32 flags can be 0 or DUP_FILE_DESC.

Session *sn is a pointer to the session.

Request *rq is a pointer to the request.