Author: Jonas Bilinkevicius
How to get the size of a text file without opening it
Answer:
Returns the size, in bytes, of the passed file:
1 function TextfileSize(const name: string): LongInt;
2 var3 SRec: TSearchRec;
4 begin5 if FindFirst(name, faAnyfile, SRec) = 0 then6 begin7 Result := SRec.Size;
8 Sysutils.FindClose(SRec);
9 end10 else11 Result := 0;
12 end;