FileSize

From SCAR Divi Manual
Revision as of 11:11, 1 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function FileSize(FileNum: Integer): LongInt; </source> ==Availability== SCAR Divi 3.00 > Current ==Description== Returns the ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function FileSize(FileNum: Integer): LongInt;

Availability

SCAR Divi 3.00 > Current

Description

Returns the file size of the file open in a stream associated with the index FileNum in the file stream resource manager.

Example

var
  f: Integer;

begin
  f := Rewritefile(LogsPath + 'Test.txt', False);
  WriteFileString(f, 'Hello World!');
  CloseFile(f);

  f := OpenFile(LogsPath + 'Test.txt', False);
  WriteLn(FileSize(f));
  CloseFile(f);

  DeleteFile(LogsPath + 'Test.txt');
end.

See Also