Updated for 1.10

This commit is contained in:
mysticbbs 2012-02-27 17:52:40 -05:00
parent 7d65434f36
commit 30d8153781
1 changed files with 98 additions and 96 deletions

View File

@ -32,20 +32,19 @@ Uses
{$I RECORDS.PAS}
Var
inFile : Text;
desFile : File;
FDirFile : File of FDirRec;
FDir : FDirRec;
InFile : Text;
DesFile : File;
FDirFile : File of RecFileList;
FDir : RecFileList;
Desc : Array[1..99] of String[50];
Str : String = '';
A : Byte;
Total : Integer;
NoSave : Boolean;
DupeCheck : Boolean;
D: DirStr;
N: NameStr;
E: ExtStr;
D : DirStr;
N : NameStr;
E : ExtStr;
Function IsDupeFile (FN : String) : Boolean;
Begin
@ -65,7 +64,7 @@ Begin
{$ELSE}
If strUpper(FDir.FileName) = strUpper(FN) Then Begin
{$ENDIF}
IsDupeFile := True;
Result := True;
Exit;
End;
End;
@ -86,22 +85,25 @@ Begin
DupeCheck := strUpper(ParamStr(3)) = '-DUPE';
Assign (inFile, ParamStr(1));
{$I-} Reset(inFile); {$I+}
Assign (InFile, ParamStr(1));
{$I-} Reset(InFile); {$I+}
If IoResult <> 0 Then Begin
WriteLn ('ERROR: PCBoard file listing (', ParamStr(1), ') not found.');
Halt(1);
Halt (1);
End;
FSplit (ParamStr(2), D, N, E);
Assign (FDirFile, D + N + '.dir');
{$I-} Reset (FDirFile); {$I+}
If IoResult <> 0 Then ReWrite (FDirFile);
Assign (desFile, D + N + '.des');
{$I-} Reset (desFile, 1); {$I+}
If IoResult <> 0 Then ReWrite (desFile, 1);
Assign (DesFile, D + N + '.des');
{$I-} Reset (DesFile, 1); {$I+}
If IoResult <> 0 Then ReWrite (DesFile, 1);
Total := 0;
@ -109,7 +111,6 @@ Begin
While Not Eof(inFile) Do Begin
If (Str[26] = '-') and (Str[29] = '-') Then Begin
If IsDupeFile(Copy(Str, 1, Pos(' ', Str) - 1)) Then
NoSave := True
Else Begin
@ -120,30 +121,31 @@ Begin
Write (Total, ' files ... ');
End;
FillChar (FDir, SizeOf(FDir), #0);
FDir.FileName := Copy(Str, 1, Pos(' ', Str) - 1);
FDir.Size := strS2I(Copy(Str, 13, 9));
FDir.DateTime := DateStr2Dos(Copy(Str, 24, 8));
FDir.Uploader := 'PCB2MBBS';
FDir.Flags := 0;
FDir.DLs := 0;
FDir.Lines := 1;
FDir.Pointer := FileSize(desFile);
FDir.DescLines := 1;
FDir.DescPtr := FileSize(DesFile);
Desc[1] := Copy(Str, 34, Length(Str));
Repeat
ReadLn (inFile, Str);
If Str[32] = '|' Then Begin
Inc (FDir.Lines);
Desc[FDir.Lines] := Copy(Str, 34, Length(Str));
Inc (FDir.DescLines);
Desc[FDir.DescLines] := Copy(Str, 34, Length(Str));
End;
Until (Str[32] <> '|') or Eof(inFile);
If Not NoSave Then Begin
Write (FDirFile, FDir);
Seek (desFile, FDir.Pointer);
Seek (DesFile, FDir.DescPtr);
For A := 1 to FDir.Lines Do Begin
For A := 1 to FDir.DescLines Do Begin
BlockWrite (desFile, Desc[A][0], 1);
BlockWrite (desFile, Desc[A][1], Ord(Desc[A][0]));
End;
@ -152,9 +154,9 @@ Begin
If Not Eof(InFile) Then ReadLn (inFile, Str);
End;
Close (inFile);
Close (InFile);
Close (FDirFile);
Close (desFile);
Close (DesFile);
WriteLn ('DONE.');
End.