I have this rutine to know the filesize:
(Based on http://delphi.about.com/od/delphitips2008/qt/filesize.htm)
function FileSize(fileName : String) : Int64;
var
sr : TSearchRec;
begin
if FindFirst(fileName, faAnyFile, sr ) = 0 then
{$IFDEF MSWINDOWS}
result := Int64(sr.FindData.nFileSizeHigh) shl Int64(32) + Int64(sr.FindData.nFileSizeLow)
{$ELSE}
result := sr.Size
{$ENDIF}
else
result := -1;
FindClose(sr) ;
end;
However, this give this warning:
[DCC Warning] Funciones.pas(61): W1002 Symbol 'FindData' is specific to a platform
I wonder if exist a clean cross-platform way to do this. I check TFile class and not found it...