Commit Command

Purpose

Flushes a file directly to disk.

Syntax

Commit #file

Description

The Commit command forces the GFA-BASIC 32 file buffer to write to the operating system. The operating system writes the data as well. Commit ensures that the specified file is flushed immediately, not at the operating system’s discretion.

Example

Local Int32 n, a(10)

For n = 0 To 10 : a(n) = Rand(10) : Print a(n) : Next n

Open "c:\Test.dat" for Output As # 1

BPut # 1, V:a(0), 44

Commit # 1         // Forces the OS to save the file to HDD

Close # 1

Print

ArrayFill a(), 0

Open "c:\Test.dat" for Input As # 1

BGet # 1, V:a(0), 44

Close # 1

Kill "c:\Test.dat" // Tidy up line

For n = 0 To 10 : Print a(n) : Next n

Remarks

See Also

Flush, Open

{Created by Sjouke Hamstra; Last updated: 27/09/2014 by James Gaite}