home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
FLIST26.ZIP
/
FLIST.DOC
< prev
next >
Wrap
Text File
|
1993-03-05
|
13KB
|
268 lines
FLIST -- Generates file lists based on privilege levels and keys
Version 2.6 (3/05/93)
Written by Bob Quinlan of Austin, Texas, USA
Sysop of Red October at 512-834-2593 (1:382/111)
Special thanks to David Powers for suggestions and code.
Copyright 1993 by Bob Quinlan
Compatible with Maximus 2.00 and 2.01
This program generates a list of files that a user with a particular
privilege level and set of keys could access. It is intended to make
the procedure independent of changes to the structure of your file
areas. Instead of specifying which areas should be included you just
specify what sort of user you want the list to apply to.
You can also create lists of new files. Just use /D to specify how many
days of files you want to list.
/Afile Area file. You can use this to specify a path to
AREA.DAT or to refer to another file (although it must
follow the AREA.DAT format). The filename must be
included along with the path. Defaults to AREA.DAT in
the current directory.
/B Include barricaded areas. If this switch is not
included no barricaded areas will be included.
/C Include comments from the FILES.BBS file lists. By
default only files and their descriptions are included.
Using this switch has one side-effect! Normally area
headers are only generated for areas that have files in
them. /C will cause them to be generated for any area
that has comments as well. Do not use /C if you only
want areas that have files in them to appear! (I
recommend not using /C with /D so that you don't show
lots of apparently empty file areas.)
/Ddays Days. Excludes all files more than this many days old.
Use this switch to create lists of new files. You
cannot use both this and the /M switch at the same time.
/Ffile Output file. The pathname of the file you want the file
list written to. Defaults to FLIST.TXT in the current
area.
/HAfile Area header file. The contents of this file will be
added to the report for each area header. There are
several sequences you can embed in the file that have
special meanings. All of the codes explained under /HS
are allowed except for %C and %B.
If no area header file is specified a default header
will be used.
/HBfile Beginning header file. The contents of this file will
be added to the beginning of the report. There are
several sequences you can embed in the file that have
special meanings. The codes %D, %T, and %A (explained
under /HS) are allowed.
/HEfile End header file. The contents of this file will be
added to the end of the report. There are several
sequences you can embed in the file that have special
meanings. The codes %F, %S, %D, %T, and %A (explained
under /HS) are allowed.
/HSfile Area summary header file. The contents of this file
will be added to the report after each area. There are
several sequences you can embed in the file that have
special meanings:
%N will be replaced with the area name.
%I will be replaced with the area information.
%C will be replaced with the area file count.
%B will be replaced with the area file size total (bytes).
%F will be replaced with the overall file count.
%S will be replaced with the overall file size total.
%D will be replaced with the report date.
%T will be replaced with the report time.
%A will be replaced with the age of the files
included (or marked) in the report. Do not use
this except with the /D or /M command line
parameters!
Any of these may be followed by an L, R, or C
immediately followed by a number. These will left,
right, or center justify the value in a field of the
specified width.
You can also follow any of the above with an NF or
with an Fx. NF stands for "no fill" and has no
effect (see examples). Fx stands for "fill" and
will cause the entire field to be replaced by an
equivalent number of the character 'x'. This is
useful when drawing boxes.
/Icode International country code. This allows you to override
the system's country code and pick another format. Give
the DOS country code for the country you want to use.
/Kkeys Keys to use for access to locked areas. Keys are
represented by 1-8 and A-X. An asterisk (*) turns on
all of the keys. Multiple keys can be specified in one
/K argument (such as /K12B).
/Mdays Mark new files. Marks all files less than or equal to
this many days old. You cannot use both this and the /D
switch at the same time.
/N No-wrap. Leave long description lines intact. The
default is to wrap them.
/O Include offline files. By default files that are listed
but not present are not included in the list.
/Ppriv Privilege to use for access to areas. Only the first
letter of the level name is required. Legal values are:
Twit
Disgrace
Limited
Normal
Worthy
Privil
Favored
Extra
Clerk
AsstSysop
Sysop
Hidden
Defaults to Normal.
/T Truncate long description lines. The default is to wrap
them.
/Vcount Volume. 'count' is the number of files each dot stands
for in the progress indicator. Zero will turn off all
progress displays.
/Wcolumn Wrap column. Sets line wrapping to the specified column
relative to the left margin.
Let me show you an example of how to use the %N and %I parameters in an
area header file (defined with the /HA switch). The purpose of those
parameters is to let you build boxes that will conform to the size of
the text produced by %N and %I. Here is an example of a simple header
box using these parameters:
┌──%NF───┬──%IF───┐
│ %NNF │ %INF │
└──%NF───┴──%IF───┘
Note that the characters following the %NF and %IF look like a part of
the regular text, but are actually the characters that will be used to
fill out the parameters to the desired length.
This will expand to something that looks like this:
┌───────┬───────────────────────────────────────────┐
│ MAX │ Maximus BBS files and related utilities │
└───────┴───────────────────────────────────────────┘
Now you can see why the apparently useless NF modifier can be useful. It
pads out the shorter embedded codes so that they visually match those in
the surrounding lines. The following would produce exactly the same
result as the previous example, but it is a lot harder to figure out how
everything will match up:
┌──%NF───┬──%IF───┐
│ %N │ %I │
└──%NF───┴──%IF───┘
Here is an example using fixed width fields. This also right justifies
the area name and left justifies the area information:
┌─%NR9F──┬─%IL50F──┐
│ %NR9NF │ %IL50NF │
└─%NR9F──┴─%IL50F──┘
Which will expand to something that looks like this:
┌───────────┬────────────────────────────────────────────────────┐
│ MAX │ Maximus BBS files and related utilities │
└───────────┴────────────────────────────────────────────────────┘
FLIST returns the following ERRORLEVELS:
0 = success
1 = bad command line parameter
2 = unable to open AREA.DAT
3 = unable to open header file
4 = unable to open output file
5 = not enough memory to run
6 = string overflow processing header
NOTICE: You may use, copy, and distribute this program freely as long
as you insure that both the executable and the documentation (.DOC)
files are included in the distribution package. The source code does
not need to be included. You may modify this program and document, so
long as reasonable credit is given to the original author if a
substantial portion of the original remains intact. The author is not
responsible for any losses which may occur either directly or indirectly
as a result of using this program.
This program uses the Maximus structures written by Scott J. Dudley.
HISTORY:
Version 2.6 (3/05/93) -- Added support for international date formats.
FLIST now reads the country code and uses the
appropriate formats automatically. The /I
options can be used to override the system's
country code.
Version 2.5 (1/18/93) -- Added the /M option to mark new files. Fixed
counting of files not present in the list.
Version 2.4 (1/10/93) -- Added the /HS option to allow customized area
summary headers in the report. Added new
embedded variables for total and area file
counts and file sizes. Fixed a bug that
occurred when inappropriate replacement codes
were used in a header.
Version 2.3 (1/10/93) -- Added /W parameter to allow line-wrapping to
different lengths. List "offline" as the
size for offline file entries.
Version 2.2 (11/04/92) -- Fixed minor date offsets caused by default
timezone and daylight savings adjustments.
Added the /V switch to limit screen output.
/V0 replaces the /Q switch.
Version 2.1 (8/26/92) -- Added the /Q switch to eliminate the progress
display. Now returns different errorlevels
for each possible error. Fixed problem with
headers before comments.
Version 2.0 (8/23/92) -- Added more error checking.
Version 1.9 (8/22/92) -- Added a progress display. Fixed a memory
corruption bug.
Version 1.8 (8/20/92) -- Added fixed width fields with left, right,
and centered justification for embedded
variables. Changed the previous codes for
embedded variables! Removed built-in help to
reduce memory requirements.
Version 1.7 (8/10/92) -- Added embedded variables to the begin and end
headers. Note: This eliminated the automatic
file age comment that used to be included for
newfile lists.
Version 1.6 (8/10/92) -- Added the /HA option to allow customized area
headers in the report. This is an expansion
of an idea and code by David Powers.
Version 1.5 (8/09/92) -- Added the /HB and /HE options to allow
customized beginning and end text in the
report. Added /? help option to print the
parameter list. Added a clearer explanation
of /C's effect on area headers.
Version 1.4 (8/07/92) -- Added the /C option to include file list
comments. Added code to recognize free
switches so they do not show up in the
descriptions. Fixed error if first entry in
AREA.DAT did not include a file area.
Version 1.3 (8/06/92) -- Read the file list filename from AREA.DAT
instead of assuming FILES.BBS.
Version 1.2 (8/02/92) -- Added days header for new files list.
Version 1.1 (7/30/92) -- Added file age cutoff.
Version 1.0 (6/30/92) -- Original release. Written in Borland C.