Directly Accessing a File I/O Buffer

Applications that are performance sensitive, such as applications that must stream data in real time from a CD-ROM, can optimize file I/O performance by directly accessing the file I/O buffer. Care should be exercised if you choose to do this—by accessing the file I/O buffer directly, you bypass some of the safe-guards and error checking provided by the file I/O manager.

The Multimedia file I/O services provide the following functions to support direct I/O buffer access:

mmioAdvance

Fills and/or flushes the I/O buffer of a file set up for direct I/O buffer access.

mmioGetInfo

Retrieves information on the file I/O buffer of a file opened for buffered I/O.

mmioSetInfo

Changes information on the file I/O buffer of a file opened for buffered I/O.

To directly access a file I/O buffer, open the file for buffered I/O, as described in “Performing Buffered File I/O,” earlier in this chapter. You can use the internal file I/O buffer or supply your own buffer with mmioSetBuffer.