Function Filesize (Var F : Any file type) : Longint;
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.
None.
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.