From SCAR Divi Manual
function CloseFile(FileNum: Integer): Boolean;
SCAR Divi 3.00 > Current
Closes a file stream stored in the file stream resource manager associated with the index specified by FileNum. Returns true the the file stream existed and was closed.
var f: Integer; s: string; begin f := Rewritefile(LogsPath + 'Test.txt', False); WriteFileString(f, 'Hello World!'); CloseFile(f); f := OpenFile(LogsPath + 'Test.txt', False); ReadFileString(f, s, FileSize(f)) WriteLn(s); CloseFile(f); DeleteFile(LogsPath + 'Test.txt'); end.