Sun Java System Web Server 6.1 SP7 NSAPI Programmer's Guide


The filebuf_open_nostat function opens a new file buffer for a previously opened file. It returns a new buffer structure. Buffered files provide more efficient file access by guaranteeing the use of buffered file I/O in environments where it is not supported by the operating system.

This function is the same filebuf_open, but is more efficient, since it does not need to call the request_stat_path function. It requires that the stat information be passed in.


filebuf* filebuf_open_nostat(SYS_FILE fd, int sz,     struct stat *finfo);


A pointer to a new buffer structure to hold the data if successful, or NULL if no buffer could be opened.


SYS_FILE fd is the platform-independent file descriptor of the file that has already been opened.

int sz is the size, in bytes, to be used for the buffer.

struct stat *finfo is the file information of the file. Before calling the filebuf_open_nostat function, you must call the request_stat_path function to retrieve the file information.


filebuf *buf = filebuf_open_nostat(fd, FILE_BUFFERSIZE, &finfo);
if (!buf) {

See Also

filebuf_close, filebuf_open, filebuf_getc, filebuf_buf2sd