next up previous contents index
Next: Fillchar Up: Functions and Procedures Previous: Filepos

Filesize

   

Declaration:

Function Filesize (Var F : Any file type) : Longint;

Description:

Filepos returns the total number of records in file F. It cannot be invoked with a file of type Text. (under LINUX, this also means that it cannot be invoked on pipes.)

If F is empty, 0 is returned.

Errors:

None.

See also:

Filepos

Example
Program Example24;

{ Program to demonstrate the FileSize function. }

Var F : File Of byte;
    L : File Of Longint;

begin
  Assign (F,paramstr(1));
  Reset (F);
  Writeln ('File size in bytes : ',FileSize(F));
  Close (F);
  Assign (L,paramstr (1));
  Reset (L);
  Writeln ('File size in Longints : ',FileSize(L));
  Close (f);  
end.



Michael Van Canneyt
Thu Sep 10 14:02:43 CEST 1998