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