The FlushViewOfFile function writes to the disk a byte range within a mapped view of a file.
BOOL FlushViewOfFile(
LPCVOID lpBaseAddress, |
// start address of byte range to flush |
DWORD dwNumberOfBytesToFlush |
// number of bytes in range |
); |
If dwNumberOfBytesToFlush is zero, the file is flushed from the base address to the end of the mapping.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Flushing a range of a mapped view causes any dirty pages within that range to be written to the disk. Dirty pages are those whose contents have changed since the file view was mapped.
When flushing a memory-mapped file over a network, FlushViewOfFile guarantees that the data has been written from the local computer, but not that the data resides on the remote computer. The server can cache the data on the remote side. Therefore, FlushViewOfFile can return before the data has been physically written to disk. However, you can cause FlushViewOfFile to return only when the physical write is complete by specifying the FILE_FLAG_WRITE_THROUGH flag when you open the file with the CreateFile function.
CreateFile, MapViewOfFile, UnmapViewOfFile
file: /Techref/os/win/api/win32/func/src/f25_9.htm, 2KB, , updated: 2000/4/7 11:19, local time: 2024/11/25 19:53,
3.14.249.104:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://techref.massmind.org/Techref/os/win/api/win32/func/src/f25_9.htm"> FlushViewOfFile</A> |
Did you find what you needed? |
Welcome to massmind.org! |
Welcome to techref.massmind.org! |
.