Mega Code Archive
Categories
/
Delphi
/
Examples
Get the size of a file
function GetFileSize(const FileName: string): Integer; var sr: TSearchRec; begin Result := 0; if FindFirst(FileName, faAnyFile, sr) = 0 then begin Result := sr.Size; FindClose(sr); end; end;