RGSETUP File Area Manager
=========================
Part of RGSETUP (Utilities menu).  It keeps Renegade's file areas in
order: checks and fixes the file listings, adds new files with their
descriptions and makes the BBS filelist.  It works FileDude 5.3 style
and reads/writes Renegade's own data files (RENEGADE.DAT, FBASES.DAT,
*.DIR, *.EXT, SYSOP.LOG) directly.

Back up your DATA directory before the first run.


UTILITIES MENU
--------------
  File Areas to Maintain   check the areas Run File Maintenance works on
                           (Space check/uncheck, A all, N none, Enter =
                           the area's description list format and file)
  Run File Maintenance     do it now - Esc stops after the current area
  File Area Settings       work path, template path, archive type to
                           convert to, new files days, filelist file,
                           virus scanner, default description, uploader,
                           description line widths
  Fix Options              \
  Description Options       > Yes/No switches
  Filelist Options          >
  Other Options            /
  Description Formats      FILES.BBS / CD-ROM list formats (Ins / Del)
  Create CD-ROM Areas      settings, then makes the areas


WHERE THINGS GO
---------------
  Settings        RGSETUP.CFG: [FileAreas], [Format1]..., [Areas]
  Work files      the BBS temp path (File Area Settings / Work Path to
                  change it); only its DIZ, SCAN, CONV and LIST
                  subdirectories are used and emptied
  Templates       ART (misc) path\FILELIST\ - made the first time
  Filelist        BBS directory\FILELIST.TXT (File Area Settings)
  Log             logs path\FILEMGR.LOG (Other Options / Keep a Log File)
  Caches          data path: FILEDIZ.DAT, VIRSCAN.DAT, DEL.LST, DEL.BBS


WHAT RUN FILE MAINTENANCE DOES (per checked area, in order)
-----------------------------------------------------------
 * Imports a file list (FILES.BBS, DESCRIPT.ION, CD-ROM indexes, TIC
   style lists, "|" or "+" continuation lines, [n] download counters,
   Renegade-style padded names) - new files get their descriptions and
   extended descriptions; existing default/empty descriptions are filled
   in (or always replaced with Description Options / Replace Descriptions).
 * Adds new uploads found on disk that aren't in the .DIR file.  Long
   file names get an 8.3 alias on disk (OLDAPO~1.ZIP) and the long name
   is kept in the record, the same way the BBS does it.
 * Reads FILE_ID.DIZ / DESC.SDI from archives, optional rewrap.
 * Removes duplicates in the area and across areas, finds old versions
   of programs (PROG10.ZIP is removed when PROG20.ZIP exists).
 * Marks missing files offline as requests, or deletes them.
 * Virus scans new uploads (errorlevel 0 = clean, 1 = virus, 2 = could
   not scan).  Archives are extracted first, nested archives to depth 3.
   Infected files are deleted unless Don't Delete Files is on, in
   which case they are left unvalidated.
 * Converts archives to the "convert TO" format (Keep Old Archives keeps
   a .BAK).  NODELIST.A32 style names are handled.
 * Fixes sizes, dates and file credits (Renegade formula: KB div
   FileCreditCompBaseSize; Credits Minimum 1 makes it at least 1).
 * Packs the .EXT files, keeping only used extended descriptions.
 * Writes DEL.LST / DEL.BBS of removed files, FILEMGR.LOG (logs path) and a summary
   in Renegade's SYSOP.LOG.
 * Builds a file list from templates, optionally compressed with a
   FILE_ID.DIZ and uploaded into the area whose path holds it (Mark
   Filelist as New dates it today so it shows as new).

Create CD-ROM Areas scans a drive or mount point, optionally recursing,
and adds an FBASES.DAT area per directory with a file list.  Area names
come from a DIRxx / DIRINFO.ROM table when given.  Areas are flagged
CD-ROM, so lists are never deleted from them.

Archivers are Renegade's (Editors / Archivers in RGSETUP): %F = archive, %I = files, plus the success errorlevel.
They run in the work path; their screen output is hidden.


FILE LIST TEMPLATES (Template Path, default ART path\FILELIST\)
-------------------------------------------------------------
  HEADER.ASC      top of the list
  PREBODY.ASC     before each area
  BODY.ASC        one line per file
  EXTLINE.ASC     each extended description line   (or EXTBODYn.ASC for
                  exactly n extended lines - the older FileDude way)
  BODYINFO.ASC    optional, after each file
  POSTBODY.ASC    after each area
  ERROR.ASC       area whose path can't be read (e.g. CD not mounted)
  FOOTER.ASC      bottom of the list
  FILE_ID.ASC     FILE_ID.DIZ for the compressed list

MCI codes (same as FileDude, plus %FO %FX):
  %DA date          %TI time          %BN BBS name     %BP BBS phone
  %SN sysop name    %FB area name
  %F1 total bytes (%F1K kilobytes)    %F2 total files  %F3 total areas
  %F4 area bytes  (%F4K kilobytes)    %F5 area files
  %FL long file name (or the 8.3 one)
  %F6 file name     %F7 size in k     %F8 description  %FD file date
  %F9 downloads     %FC credits       %FO uploader     %FX size in bytes
  %FE extended line (EXTLINE.ASC)     %FEn extended line n (EXTBODYn.ASC)
  %[one/many]  picks the singular or plural form from the last number

Width and precision:  %F6#-12  pads to 12 left-aligned,  %F7#7  right-
aligned to 7,  %F8:50  cuts at 50 characters.


Virus scanner commandline codes:
           %D = directory holding the file(s) to scan (work path\SCAN),
           %F = the file(s) in it.
  DOS example:    F-PROT.EXE %D /NOMEM
  Linux example:  sh -c 'clamscan -r --no-summary %D; [ $? -eq 1 ]'
                  (or any wrapper returning 0 clean / 1 virus / 2 error)



LINUX
-----
Renegade on Linux expects upper case file names; Other Options / Upper
Case Names renames new uploads to upper case.  Paths with "\" are
converted.  Use case-insensitive archivers (unzip -C ...) in Renegade's
archiver setup.  Commands run through /bin/sh -c.
