«« Site Rescued »»

While the site is still going to move from its current host, a new site will now take its place. More Info.

The new site may have less content, but the core will now remain. And it will now play nicely with phones! Keep an eye on the DelphiDabbler Blog for news.

» Help

How to get the size of a text file without opening it

   

This function returns the size, in bytes, of the passed file:

function TextfileSize(const name: string): LongInt; 
var
  SRec: TSearchRec;
begin
  if FindFirst(name, faAnyfile, SRec) = 0 then
  begin
    Result := SRec.Size;
    Sysutils.FindClose(SRec);
  end
  else
    Result := 0;
end;
Original resource: The Delphi Pool
Author: Peter Below
Added: 2010-06-02
Last updated: 2010-06-02

« Return to contents »