function FileSize(const FileName: string): Int64;
var sr: TSearchRec;
begin
if FindFirst(FileName, faAnyFile, sr) = 0 then
try
Result := Int64(sr.FindData.nFileSizeHigh) shl Int64(32) + Int64(sr.FindData.nFileSizeLow);
finally
SysUtils.FindClose(sr);
end
else
Result := -1;
end;