From fabc938d2058001bf965df2ade25efb89cf1fd00 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Wed, 22 Feb 2012 18:08:36 -0500 Subject: [PATCH] Initial import --- utilities/pcb2mbbs.pas | 139 +++++++++++++++++++++++++++++++++++++++++ utilities/pcb2mbbs.txt | 81 ++++++++++++++++++++++++ 2 files changed, 220 insertions(+) create mode 100644 utilities/pcb2mbbs.pas create mode 100644 utilities/pcb2mbbs.txt diff --git a/utilities/pcb2mbbs.pas b/utilities/pcb2mbbs.pas new file mode 100644 index 0000000..89c7409 --- /dev/null +++ b/utilities/pcb2mbbs.pas @@ -0,0 +1,139 @@ +Program PCB2MBBS; + +{$I M_OPS.PAS} + +Uses + CRT, + DOS, + m_Strings, + m_DateTime; + +{$I RECORDS.PAS} + +Var + inFile : Text; + desFile : File; + FDirFile : File of FDirRec; + FDir : FDirRec; + Desc : Array[1..99] of String[50]; + Str : String = ''; + A : Byte; + Total : Integer; + NoSave : Boolean; + DupeCheck : Boolean; + + D: DirStr; + N: NameStr; + E: ExtStr; + +Function IsDupeFile (FN : String) : Boolean; +Begin + IsDupeFile := False; + + If Not DupeCheck Then Exit; + + Reset (FDirFile); + + While Not Eof(FDirFile) Do Begin + Read (FDirFile, FDir); + + If FDir.Flags and FDirDeleted <> 0 Then Continue; + + {$IFDEF FS_SENSITIVE} + If FDir.FileName = FN Then Begin + {$ELSE} + If strUpper(FDir.FileName) = strUpper(FN) Then Begin + {$ENDIF} + IsDupeFile := True; + Exit; + End; + End; +End; + +Begin + WriteLn; + WriteLn ('PCB2MBBS : PCBoard to Mystic BBS File Base Converter'); + WriteLn ('Copyright (C) 1998-2012 By James Coyle. All Rights Reserved'); + WriteLn; + WriteLn ('Compiled for Mystic BBS v' + mysVersion); + WriteLn; + + If ParamCount < 2 Then Begin + WriteLn ('Usage: [PCBoard File] [Mystic BBS File] -DUPE'); + Halt(1); + End; + + DupeCheck := strUpper(ParamStr(3)) = '-DUPE'; + + Assign (inFile, ParamStr(1)); + {$I-} Reset(inFile); {$I+} + If IoResult <> 0 Then Begin + WriteLn ('ERROR: PCBoard file listing (', ParamStr(1), ') not found.'); + 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); + + Total := 0; + + Write ('Processing: '); + + 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 + NoSave := False; + + Inc (Total); + GotoXY (13, WhereY); + Write (Total, ' files ... '); + End; + + 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); + + 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)); + End; + Until (Str[32] <> '|') or Eof(inFile); + + If Not NoSave Then Begin + Write (FDirFile, FDir); + Seek (desFile, FDir.Pointer); + + For A := 1 to FDir.Lines Do Begin + BlockWrite (desFile, Desc[A][0], 1); + BlockWrite (desFile, Desc[A][1], Ord(Desc[A][0])); + End; + End; + End Else + If Not Eof(InFile) Then ReadLn (inFile, Str); + End; + + Close (inFile); + Close (FDirFile); + Close (desFile); + + WriteLn ('DONE.'); +End. diff --git a/utilities/pcb2mbbs.txt b/utilities/pcb2mbbs.txt new file mode 100644 index 0000000..728bd74 --- /dev/null +++ b/utilities/pcb2mbbs.txt @@ -0,0 +1,81 @@ + .------------------------. + | PCB2MBBS Documentation |------------------------------------------- + `------------------------' + + What is PCB2MBBS? + ----------------- + + PCB2MBBS is a program which will convert PCBoard style file + listings to Mystic BBS. This is useful for importing CD-ROMs + into Mystic BBS, since most CD-ROMs that are BBS ready include + at least PCBoard file listings. It may also be useful for + automatically importing files on a file network if your software + can maintain a PCBoard-type file listing. + + Using PCB2MBBS + -------------- + + Usage PCB2MBBS is fairly easy, but sometimes time consuming if you + are importing an entire CD-ROM with many directories. The command + line parameters are as follows: + + PCB2MBBS: <-DUPE> + + <-DUPE> is the command line option to turn on duplicate file + searching. This is needed if you have a 3rd party program keeping + a list of files in PCBoard format, and you only need to import + files which aren't yet added into Mystic. PCB2MBBS will search + each file in the file listing to see if it already exists in your + Mystic file base. + + is the full path and filename of the PCBoard file + listing to convert to Mystic BBS format. + + is the full path and filename of the Mystic BBS + file which will be created. The file extention does not need to + be supplied, since PCB2MBBS will just strip it. Two files are + outputted for each file directory converted: + + .DIR : Holds the file information for this base. + .DES : Holds the file descriptions for this base. + + These files either need to be created in the DATA directory, or + copied to the data directory after created. + + An example of running PCB2MBBS.EXE if the PCBoard files list was + "D:\BBSDESC\DIR1.LST" and the path to the Mystic BBS data directory + was "C:\MYSTIC\DATA\" : + + PCB2MBBS.EXE D:\BBSDESC\DIR1.LST C:\MYSTIC\DATA\DIR1 + + The above command line parameter will convert the PCBoard file list + located in "D:\BBSDESC\DIR1.LST" into the Mystic BBS data directory + under the filename "DIR1". + + After a file base has been converted, you need to go into the + Mystic BBS file base editor and add the file base to go along with + the data files that you've just converted. The "FileName" field + of this added file base should be "DIR1" since that was the filename + that you told PCB2MBBS to use. The following is a screen capture + of the File Base Editor. Option [B] should now be changed to "DIR1" + Option [H] should be changed to the path on the CD-ROM which stores + the files which you've just imported. + + File Base 1 of 1 + + A. Name : Directory 1 of CD-ROM + B. Filename : DIR1 + C. Display File : + D. ACS : s20 + E. List ACS : s20 + F. Upload ACS : s255 + G. Download ACS : s20 + H. Storage Path : D:\DIR1\ + I. Password : + J. Show Uploader : Yes + K. Default NewScan: Yes + + Command (Q/Quit): + + -------------------------------------------------------------------- + Any suggestions/bug reports? E-mail: mysticbbs@geocities.com