home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / bbs / qlist2.arc / QLIST.DOC next >
Text File  |  1989-03-03  |  18KB  |  389 lines

  1.  
  2.                               Q L I S T
  3.                      QuickBBS On-Line File Lister
  4.                              Version 2.0
  5.  
  6.               (c) Copyright 1988, 1989 by Richard Lovett
  7.                            Kansas City, Mo. 
  8.  
  9.       - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  10.  
  11.       This program is public domain.  No fee is requested,  and
  12.       QLIST can be freely copied and distributed as long as it is
  13.       not sold or used in a commercial application.  However, the
  14.       author retains a copyright and all of its associated rights
  15.       and privileges.
  16.  
  17.       I wish to acknowledge the work of Dan Barrett of CORE BBS
  18.       (619-295-2912), whose QFL (QuickBBS File Lister) inspired me
  19.       to write QLIST.  I have made liberal use of concepts from QFL,
  20.       but have put several additional features into QLIST that I hope
  21.       make it more useful.
  22.  
  23.       Files that should be in this .ARC or .ZIP file are:
  24.          QLIST.EXE ----- The executable program
  25.          QLIST.DOC ----- This file
  26.  
  27.      If you would like to repay me for the use of this program, let me
  28.      know how you like QLIST or what changes you'd like to see. Worse
  29.      than no payment for a program is no feedback.
  30.  
  31.      VERSION HISTORY:
  32.  
  33.        Ver. 1.0 -- Sept. 88 -- First public release.
  34.  
  35.        Ver. 1.1 -- 9/19/88 --- Added features to generate statistics
  36.                                on total files, total bytes and bytes
  37.                                free in a file list.
  38.  
  39.        Ver. 2.0 -- 3/1/89 ---- Made the file compression commands more
  40.                                flexible to accomodate PKZIP and
  41.                                future file compression programs. Fixed a
  42.                                bug that caused filenames beginning with
  43.                                a digit to be dropped from lists.
  44.  
  45.      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  46.  
  47. QLIST produces an on-line list of all or part of the files on a 
  48. QuickBBS or Fido-Net bulletin board system.  By means of a QBBS 
  49. or Fido event (in which the BBS exists to DOS at a predetermined
  50. time and errorlevel and triggers a batch file), QLIST can be 
  51. set to produce this list -- or several different lists -- automat-
  52. ically as often as you wish.  My QBBS board executes QLIST at 1 a.m. 
  53. daily.
  54.  
  55. QLIST is keyed to security levels.  Users will get a list of only
  56. the  files they have access to.  You can have QLIST create lists for
  57. as many different access levels as you want, and QLIST will store
  58. each of them in whatever directory you specify.  QLIST also can
  59. compress the lists for easier downloading, using the file compres-
  60. sion program of your choice.
  61.  
  62. QLIST requires three external files:
  63.  
  64.    1.  FLSEARCH.CTL.  If you are a QuickBBS sysop, you know the purpose 
  65.        of this file and how to create it.  For the non-QBBS sysop,
  66.        FLSEARCH.CTL is a text file you create that contains paths and
  67.        privilege levels for each of the QBBS files subdirectories.  If
  68.        you are a Fido-Net sysop, read below for instructions on
  69.        creating FLSEARCH.CTL.  QLIST must be in the same directory as
  70.        FLSEARCH.CTL.
  71.  
  72.    2.  QLIST.CTL.  This is another text file you create.  It is a
  73.        setup file that tells QLIST what to do.  QLIST.CTL must be in
  74.        the same directory as QLIST.
  75.  
  76.    3.  FILES.BBS.  You probably have one of these files in each of
  77.        your BBS files subdirectories.  QLIST uses FILES.BBS to know
  78.        what files are in each subdirectory, and also uses the
  79.        descriptions you have given to each file.
  80.  
  81. If QLIST cannot find FLSEARCH.CTL or QLIST.CTL, it will halt with an 
  82. error message.  If it cannot find a FILES.BBS file in a particular 
  83. directory, it won't stop, but it won't produce a list of the files 
  84. in that directory.  Conversely, QLIST will not include any files in
  85. the output file that aren't listed in FILES.BBS.
  86.  
  87. You can run QLIST from the DOS command line by making sure the directory 
  88. containing QLIST and QuickBBS is the default and then typing "QLIST"
  89. (without the quote marks) at the DOS prompt.  Or, as indicated earlier, 
  90. you can include QLIST in a batch file.
  91.  
  92. When run, QLIST reads data from QLIST.CTL in order to know what lists 
  93. you want created, what privilege levels each list is associated with, 
  94. and the name and path of the output file for each list.  QLIST then 
  95. reads data from FLSEARCH.CTL and matches security levels in each of 
  96. its file areas with the security levels you specified in QLIST.CTL.  
  97.  
  98. For each list you specify in QLIST.CTL, QLIST creates a list of 
  99. all files with a security level equal to or less than the level you 
  100. desire, gives it a filename you specify, and puts it in whatever 
  101. subdirectory you want.  You also have the option for QLIST to
  102. compress the output file, and to erase the original afterward.
  103.  
  104.  
  105. ------------------
  106. CREATING QLIST.CTL
  107. ------------------
  108.  
  109. QLIST.CTL is an ASCII text file that consists largely of keywords
  110. (special commands), some followed by other text or commands.  The
  111. sample QLIST.CTL file below should make it clear how to write one.
  112.  
  113. There are 14 keywords.  (As of Ver. 2, these include three new keywords
  114. -- COMPRESS, COMMAND and COMPFILE -- and the keyword ARC has been
  115. dropped.)  The keywords can be typed in uppercase or lowercase, but
  116. they should be flush left (no leading spaces) and should have at least
  117. one space following them.  The keywords are:
  118.  
  119.      HEADER -- Header lines are printed at the top of the file list 
  120.      and can include your BBS name, phone number, sysop name and 
  121.      whatever else you want.  You can have up to 10 header lines,
  122.      each up to 79 characters long.  Each line will be centered.
  123.      Any text following the word HEADER will be put in the file.  If
  124.      you want a blank line in the heading, just type HEADER on a line
  125.      by itself.
  126.  
  127.      FOOTER -- Works the same as a header but is printed at the end of
  128.      the file.  You can have up to 10 footer lines, each 79 or fewer
  129.      characters.  Footer lines will be written flush left rather than
  130.      centered.
  131.  
  132.      TARGET -- This is the full path and filename of the list file
  133.      that QLIST will create.  You will want to make sure you put this
  134.      file in a subdirectory (file area) accessible to callers with the
  135.      security level you specify for this particular list.
  136.  
  137.      SECURITY -- Whatever number you type after this keyword will 
  138.      govern which of your BBS file areas will be listed in a 
  139.      particular QLIST list.  If you enter 5, QLIST will include all 
  140.      file areas with a security of 5 or less.  Numeric security levels 
  141.      will mean more to QBBS sysops than to Fido sysops, but for purposes 
  142.      of QLIST, both systems can use numeric privilege levels.  (See the
  143.      section on FLSEARCH.CTL below.)
  144.  
  145.      COMMENTS -- QLIST parses through the FILES.BBS file in each file
  146.      area that will be part of a list, and includes some of that 
  147.      information in the output file.  Most sysops put headings and
  148.      comments in their FILES.BBS files along with the filenames and
  149.      descriptions.  If you put the keyword COMMENTS in a setup, those
  150.      extra lines will be included in the output.  The default is to
  151.      leave them out.
  152.  
  153.      If comments are omitted, that also omits any heading you may
  154.      have typed into FILES.BBS to tell users which file area is
  155.      being listed, etc.  In that case, QLIST gets the name of the
  156.      file area from FLSEARCH.CTL.  (The underline characters that
  157.      represent spaces in FLSEARCH.CTL will be converted to spaces.)
  158.      If comments are included, QLIST assumes that one or more of the
  159.      comment lines in FILES.BBS constitutes the heading, and will
  160.      not generate its own from FLSEARCH.CTL.
  161.  
  162.      Similarly, if you include comments, QLIST assumes you have
  163.      included in FILES.BBS a header along the lines of:
  164.  
  165.        FILENAME   SIZE    DATE    DESCIPTION
  166.        --------   ----    ----    ------------------------------
  167.  
  168.      Therefore, it will not generate its own.  However, if COMMENTS is
  169.      not specified in the setup, QLIST will provide such a heading for
  170.      you.
  171.  
  172.      MISSING -- If a filename is shown in FILES.BBS that doesn't exist
  173.      on disk, you can choose whether to have QLIST include that
  174.      filename and description in the output list.  The default is 
  175.      to show only files that actually exist.  But if for some reason 
  176.      you want missing files to show, include the keyword MISSING in 
  177.      the setup.  As with QuickBBS itself, QLIST will print "MISSING" 
  178.      instead of the number of bytes for that file.
  179.  
  180.      COMPRESS -- If you include this keyword in a setup, QLIST will
  181.      use your favorite file compression program (PKARC, PKZIP,
  182.      ARC5-1, etc.) to compress the output file.  The word COMPRESS
  183.      *must* be followed by one or more spaces and then the full
  184.      path\filename of your file compression program.  You also must be
  185.      sure to include COMMAND and COMPFILE commands in your setup.
  186.  
  187.      COMMAND -- This keyword should be followed by one or more spaces
  188.      and then the command string you wish to pass to the file
  189.      compression program.  The string can be up to 80 characters
  190.      long and can include full paths, switches and wildcards.  This
  191.      is the same string you would type on the DOS command line
  192.      following the name of the compression program if you were
  193.      executing a compression from the DOS prompt.  For example, if you
  194.      wanted to compress a file at the DOS prompt using PKZIP.EXE, you
  195.      might type:
  196.  
  197.         PKZIP -a NEWFILE.ZIP C:\QUICK\BBSFILES.LST -ea4 -eb4
  198.  
  199.      The command string passed to PKZIP in this example is
  200.      "-a NEWFILE.ZIP C:\QUICK\BBSFILES.LST -ea4 -eb4".  That is what
  201.      you would type following the keyword COMMAND if using QLIST.
  202.  
  203.      COMPFILE -- This keyword should be followed by one or more spaces
  204.      and then the full path\filename of the compressed file that
  205.      will result from executing the compression program.   In the
  206.      above example, NEWFILE.ZIP is the name of the file after
  207.      compressing.
  208.  
  209.      Before creating a compressed file, QLIST will first check to
  210.      see if a compressed file of the same name exists;  if so, that
  211.      file will be erased. Otherwise, the compression program
  212.      (depending on which one your're using) might add the new list
  213.      to the old compressed file.
  214.  
  215.      ERASE -- After QLIST compresses a list file, the original
  216.      file normally will be preserved.  If you include the keyword
  217.      ERASE in your setup, QLIST will delete the original output
  218.      file.  If you specify ERASE but not COMPRESS in your setup,
  219.      ERASE will be ignored.  Otherwise, you'd have no original
  220.      output file and no compressed version either!
  221.  
  222.      NOERROR -- QLIST generates an error file on disk called QLIST.ERR
  223.      if it has any problems.  This is a text file that you can read in
  224.      order to find out why QLIST isn't producing the file lists you
  225.      intended.  If there are problems you don't correct, this file
  226.      could grow after a while.  Putting NOERROR in QLIST.CTL disables
  227.      the error file.  Then your only indication of what's going wrong
  228.      will be on-screen error messages while QLIST is running.  (They
  229.      duplicate what's printed in QLIST.ERR.)
  230.  
  231.      NOTOTALS -- At the end of each output file, QLIST prints the total
  232.      number of files and the total bytes in the list.  If you don't
  233.      want this information in the file, putting the keyword NOTOTALS
  234.      in QLIST.CTL will disable these entries.
  235.  
  236.      FREE -- If you want QLIST to show at the end of the output file
  237.      how many bytes free remain on the disk drive containing QLIST,
  238.      put this keyword in QLIST.CTL.  The file will then contain a line
  239.      just before the footers saying, "Space available -- xxx bytes",
  240.      giving the appropriate number.  If your BBS files are spread across
  241.      more than one disk drive, the FREE command will give an inaccurate
  242.      reading.  The default is to omit the bytes-free line.
  243.  
  244.      END -- This marks the end of a setup and must be the last line in
  245.      the setup.
  246.  
  247.  
  248. Any line in QLIST.CTL that does not begin with a keyword will be
  249. ignored, so you can include blank lines and comments as you wish.
  250.  
  251.  
  252. -----------------------
  253. A SAMPLE QLIST.CTL FILE
  254. -----------------------
  255.  
  256.                        ** Sample QLIST.CTL file **
  257.  
  258. These three lines are a comment because they don't start with a keyword.
  259. Keywords can be in caps or lowercase, or a mixture.  (Note:  keywords 
  260. should be flush left.)
  261.  
  262. HEADER    City Hall BBS
  263. HEADER    Richard Lovett, Sysop
  264. HEADER    Operating at 300/1200 baud, 24 hrs./7 days a week
  265. HEADER    (816) 274-2603
  266. HEADER    The first municipally operated public bulletin board in America
  267. HEADER    and still the best.
  268. HEADER    --------------------------------------------------------------------
  269. HEADER
  270.   (The header line immediately above will be a blank line)
  271.  
  272. NOERROR   (This turns off the error file)
  273. { --------- all of the above need only appear once in QLIST.CTL ---------- }
  274.  
  275. *** This is setup #1 ****
  276. TARGET    C:\quick\lists\allfiles.lst
  277. SECURITY  5
  278. COMMENTS
  279. MISSING
  280. FOOTER    For news you can use, watch Channel 25 on American Cablevision.
  281. NOTOTALS  (Total files & total bytes will not be shown in this list)
  282. END
  283.  
  284. *** This is the second setup -- you could have many more ***
  285. TARGET    C:\QUICK\BBSFILES.LST
  286. SECURITY  20
  287. ;MISSING  This line is merely a comment because ";" is not part of a keyword
  288. COMPRESS  C:\UTILITY\PKZIP.EXE
  289. COMMAND   -a c:\quick\bbsfiles.zip c:\quick\bbsfiles.lst -ea4 -eb4
  290.   { note that the path\file below duplicates the destination filename above}
  291. COMPFILE  c:\quick\bbsfiles.zip
  292. ERASE     (This erases BBSFILES.LST after BBSFILES.ZIP is created)
  293. FREE      (This adds a "Space available" statement)
  294. END
  295.  
  296.  
  297. ------------------------
  298. SAMPLE FLSEARCH.CTL FILE
  299. ------------------------
  300.  
  301. For the benefit of a non-QBBS sysop, FLSEARCH.CTL is an ASCII text file
  302. that QuickBBS uses to search file directories when a caller asks for a
  303. list of new files since he or she last called.  QLIST uses FLSEARCH.CTL
  304. for a different purpose:  to know what file areas (subdirectories)
  305. should be included in a particular on-line list.
  306.  
  307. Every line in FLSEARCH.CTL contains three elements, each separated by one
  308. or more spaces.  They must be in the following order and are not case
  309. sensitive (either caps or lowercase is okay):
  310.  
  311.        1.  The full path to a file area
  312.        2.  The minimum security level (privilege) associated with that area.
  313.        3.  A name for the area.  Any spaces in the name must be replaced
  314.            with underline characters.  (QLIST will remove the underlines
  315.            later when it puts the name in a file list.)
  316.  
  317. An example FLSEARCH.CTL file:
  318.  
  319. C:\QUICK\SERVICES   5  Area_A_--_City_Services
  320. C:\QUICK\LISTS      5  Area_B_--_Handy_Lists
  321. C:\QUICK\RESERVED  20  Area_C_--_Privileged_Area
  322. C:\QUICK\SYSOP    100  Area_Z_--_Sysop's_Private_Area
  323.  
  324.  
  325. QuickBBS uses numeric security levels, whereas Fido-Net uses the
  326. privilege levels TWIT, DISGRACE, NORMAL, PRIVEL, EXTRA and SYSOP.  For
  327. purposes of QLIST, a Fido sysop can assign an arbitrary security level
  328. number to each of the file areas in FLSEARCH.CTL.  "Normal" users could
  329. have, say, level 5.  "Privel" users could be level 20, "Extra" users 50
  330. and "Sysop" users 100.  These levels will not affect Fido in any way and
  331. will only be used by QLIST.  Don't use numbers bigger than 32767.
  332.  
  333. So, in the above FLSEARCH.CTL example and using the security levels just
  334. suggested, "Normal" Fido users would have access to areas A and B;
  335. "Privel" users would have access to A, B and C; and the sysop would have
  336. access to all areas.
  337.  
  338. Assuming the above QLIST.CTL and FLSEARCH.CTL files are used, QLIST
  339. would first generate a list of all the files in C:\QUICK\SERVICES and
  340. C:\QUICK\LISTS and would name the resulting file ALLFILES.LST and put it
  341. in the C:\QUICK\LISTS\ subdirectory, which (to state the obvious) is
  342. one of the file areas accessible to level-5 users.
  343.  
  344. (** NOTE: It would be up to you to put an entry manually in
  345. C:\QUICK\LISTS\FILES.BBS to indicate the presence of ALLFILES.LST.)
  346.  
  347. ALLFILES.LST would contain any comments that happened to be in the
  348. FILES.BBS files in those subdirectories, and any filenames in
  349. FILES.BBS that didn't exist on disk would be listed anyway.  No
  350. totals would be shown at the bottom of the list.
  351.  
  352. The program would then generate a list of all the files in
  353. C:\QUICK\SERVICES, C:\QUICK\LISTS and C:\QUICK\RESERVED, name the
  354. output file BBSFILES.LST and put it in the C:\QUICK\ subdirectory.
  355. Comments in the various FILES.BBS files would not be included (because
  356. the reserved word MISSING is commented out), and BBSFILES.LST would be
  357. compressed after its creation.  (Its name would then be BBSFILES.ZIP.)
  358. The original BBSFILES.LST would then be erased.  The list would
  359. include a line at the bottom showing the total number of files in the
  360. list and their total bytes (because NOTOTALS was not in the setup).  A
  361. line showing upload space available also would be added (because of
  362. the presence of the keyword FREE).
  363.  
  364. Both ALLFILES.LST and BBSFILES.LST would contain the header and footer
  365. information given at the top of the setup file.  Files in C:\QUICK\SYSOP\
  366. would not show up in either list because that area has a security level
  367. of 100, higher than the maximum security specified in the two setups.
  368. (A third setup for the sysop's use could include the level-100 files.)
  369.  
  370.  
  371. I hope QLIST proves useful to you.  I would consider releasing the Turbo
  372. Pascal Ver. 4.0 source code to QBBS sysops on a case-by-case basis.
  373. Feel free to contact me if you have any comments or suggestions about
  374. the program:
  375.  
  376.      Richard Lovett
  377.      6649 Oak
  378.      Kansas City, Mo.  64113
  379.      City Hall BBS (816-274-2603)
  380.      CompuServe ID:  75425,666
  381.  
  382.      Send net-mail via Transient Technologies,
  383.        Fido-Net node 1:280/302
  384.  
  385.  
  386. 3/89
  387. diately above will be a blank line)
  388.  
  389. N