Program pc_disk;
{$C-}
Type
  word         = array [1..2] of char;
  cat_type     = record
                   vol_record : integer;
                   fil        : string[11];
                   sizelo     : word;
                   sizehi     : word;
                   time       : word;
                   date       : word;
                   memo       : string[33];
                 end;

Var
  fname,volume                  : string[14];
  tbytes, bytes                         : real;
  catfile                       : file of cat_type;
  one_cat                       : cat_type;
  catname                       : string[14];
  x                             : integer;

begin
  bytes := 0.0;
  x := 0;
  write ('Enter file to check ');
  readln (catname);
  assign (catfile,catname);
  reset(catfile);
  while not eof(catfile) do
    begin
      read (catfile, one_cat);
      if one_cat.vol_record <> -1 then
        begin
          tbytes := ord(one_cat.sizelo[1]) + ord(one_cat.sizelo[2])*256.0 +
                    ord(one_cat.sizehi[1])*65536.0;
          bytes := bytes + tbytes;
          x := x + 1;
        end;
    end;
  close(catfile);
  writeln;
  writeln ('Total files = ',x);
  writeln ('Total bytes = ',bytes:8:0);
end.
 { True when program is run }

{ To customize code for your printer and desires - adjust the next two items }

 