更改 I/O 缓冲区大小

以下示例打开名为SAMPLE.TXT的文件用于未缓冲的 I/O,然后使用 mmioSetBuffer 函数通过内部 16K 缓冲区启用缓冲 I/O。

HMMIO hFile; 

if ((hFile = mmioOpen("SAMPLE.TXT", NULL, MMIO_READ)) != NULL) 
{ 
    // File opened successfully; request an I/O buffer. 
    if (mmioSetBuffer(hFile, NULL, 16384L, 0)) 
        // Buffer cannot be allocated. 
    else 
        // Buffer allocated successfully. 
} 
else 
    // File cannot be opened.