CFile:Flush


The Flush method commits data residing in operating system file buffer to the file attached to the CFile object.

Syntax

bResult = CFile:Flush()

bullet.gif    On success, this method returns true.

bullet.gif    On failure, including end-of-file, this method returns false.

Remarks

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.

Example

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:

s = "My string" ; n = 12.553

 

F:Printf("'%s': v=%-12lg\n", s, n ))

-- do a formatted print to the file

F:Flush()

-- makes sure the data are in the file

Related Topics

CFile class, Printf


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.