Lazarus. I get FileSize error : I get error:

unit1.pas(91,31) Error: Incompatible type for arg no. 1: Got "File Of Byte", expected "AnsiString"

    var
        f : file of byte; 
    
    ...

    AssignFile(f, FileName);
    Reset(f);
    try
      TotalBytes := FileSize(f); // line 93
    finally
      CloseFile(f);
    end;  

    Someone can me help ?