CFile:Flush
The Flush method commits data residing in operating system file buffer to the file attached to the CFile object.
bSuccess = CFile:Flush() where |
bSuccess is the returned success code. On success it is true, otherwise false.
The operating system buffers file access so that data are committed to the file only when the buffer becomes full. The Flush method causes the operating system to transfer the buffer contents to the file, regardless of whether the buffer is full.
Suppose a CFile named F exists and the file is open for writing. The script below writes formatted text to the file and then flushes the system file buffer:
|
|
|
-- do a formatted print to the file |
|
-- makes sure the data are in the file |