{
 $Id$
}

{ezycom 1.10}

Procedure Bbs4;
Type
  flagtype       = array[1..4] of byte;

  securitytype  = record
     security    : word;
     onflags,
     offflags    : flagtype;
  end;

  filepathrecord = record     { filepath.ezy }
      filepath    : string[60];
      filesbbs    : string[60];
      ksperfp     : byte;
      security    : securitytype;
      uploadarea  : word;
      password    : string[8];
      minimumage  : byte;
      attribute   : byte;
      freespace   : array[1..110] of byte;
   end;

   filerecord = record { files.ezy }
     name         : string[30];
     attribute,
     attribute2,
     convert      : byte;
     filegroup    : char;
     altgroups    : array[1..3] of char;
     minimumage   : byte;
     upfilearea,
     areapath     : word;  (* relates to FILEPATH.EZY *)
     listsecurity,
     upsecurity,
     syssecurity  : securitytype;
     freespace    : array[1..55] of byte;
  end;

Var
  FFile : File of Filerecord;
  F     : Filerecord;
  FPFile: File of FilePathRecord;
  FP    : FilePathrecord;
  Tel   : Word;

Begin
  Writeln('Converting Ezycom 1.10 file areas.',#10#13);

  Assign(Ffile, BbsPath + 'FILES.EZY');
  {$I-} Reset(Ffile); {$I+}
  If ioresult <> 0 then
    Begin
      Writeln('Cannot find '+bbspath+'FILES.EZY!');
      Halt;
    End;

  Assign(FPfile, BbsPath + 'FILEPATH.EZY');
  {$I-} Reset(FPfile); {$I+}
  If ioresult <> 0 then
    Begin
      Writeln('Cannot find '+bbspath+'FILEPATH.EZY!');
      Halt;
    End;

  AddToFile(false);

  Tel := 0;
  While not eof(ffile) do
    Begin
      {$I-} Read(Ffile,F); {$I+}
      If ioresult <> 0 then
        Begin
          Writeln('Error reading '+bbspath+'FILES.EZY!');
          Halt;
        End;
      {$I-} Read(Fpfile,Fp); {$I+}
      If ioresult <> 0 then
        Begin
          Writeln('Error reading '+bbspath+'FILEPATH.EZY!');
          Halt;
        End;

      Inc(Tel);
      If F.name <> '' then
        Begin
          Inc(Number);
          Bbs.on   := False;
          Bbs.name := F.Name;
          Bbs.nr   := Tel;
          Bbs.path := FP.FilePath;
          AddToFile(saveset);
        End;
    End;
  Close(Ffile);
  Close(FpFile);
End;



