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


The filebuf_open 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.


filebuf *filebuf_open(SYS_FILE fd, int sz);


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 which has already been opened.

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


filebuf *buf = filebuf_open(fd, FILE_BUFFERSIZE);if (!buf) {    system_fclose(fd);}

See Also

filebuf_getc, filebuf_buf2sd, filebuf_close, filebuf_open_nostat