
                                 DLGFileList
               A File Area Lister for the DLG Professional BB/OS
                     Copyright (c) 1991, Michael B. Smith

                          Version 1.02, July  4, 1991

PURPOSE:

DLGFileList is a program which generates a 'list' file of all specified
DLG file areas, in three different possible ways. These lists can be
archived and then downloaded by users for offline reference to the
available files on a given BBS.

You will probably want to generate a separate file for each SIG on your
system. You may specify as many file areas to DLGFileList as you wish (up
to the AmigaDOS input-line character limit [255?]).

This program has been tested on both 1.3 and 2.0.


LEGALITIES:

DLG and DLG Professional are registered trademarks of Telepro Technologies.

DLGFileList is NOT public domain or freeware. It is shareware. You are
provided no warranties, express or implied, concerning your use of the
software. That is, it is provided "as is". I've tested it, it works for me,
and if you can use it, that is great. If you want to send me $10US, or a
great new PD/ShareWare program, then that would be great, too. I would
appreciate bug reports.

I can be contacted at:

                The Amiga Bandwidth BBS at 804-977-3810 (300/2400 MNP-5)
                                       and 804-971-9853 (96/14.4 HST/V.32)
                and as mbs@turing.acs.Virginia.EDU,
                Or, (last chance :)) US Mail:

                            Michael B. Smith
                            41 Oak Grove Road
                            Palmyra, VA 22963

I normally read comp.sys.amiga.programmer and comp.sys.amiga.misc on NetNews.


THANKS:

Thanks Peter!


INSTALLATION & USE:

1) Copy the file DLGFileList somewhere in your standard Path (like DLG:).

2) On a SIG per SIG basis, create 'batch' files which mimic the example
file DLGAmiga.Batch for each SIG.  Remember to 'protect <batchfiles> +s'
after you create them.

3) Place an entry into your CronTab for each batchfile. This should be run
(minimally!) after each time you have DLG renumber the file areas. Every
day would be better, assuming you have a fair amount of upload activity.

4) Hurl the generated archives (or just the listings if you prefer) into a
general file area for user downloads.


GENERAL INFORMATION:

DLGFileList is easy to use. Look at the example batch file DLGAmiga.Batch
for all you need to know. However, here is some more stuff to help:

Runtime Template:

     DLGFileList "<sig title>" <outputfile> [-d] [-[c|q]] areas......

Example:

     DLGFileList "General" General.Lst -c 1 2 3 4 5

which creates an <outputfile> called 'General.Lst' for a SIG named
'General' consisting of file areas one through five. The listing is in the
COMPACT format. The <outputfile> may be "*" (for stdout).

The "-d" option will cause debugging information to be displayed. If a
problem occurs, please capture the debugging information to help me figure
the problem out.

There are three different output formats for the <outputfile>. The default
is fairly verbose and looks something like this for each file:

nnnn xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx sssssss, dddddddddddddd, uuuuuuuuuuuuu
     ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
     ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt

where 'n' represents the file number in the particular file area. The 'x's
represent the name of the file, 's' is the size of the file in bytes, 'd is
the date/time it was uploaded, and 'u' is the user who uploaded the file.
Text/comments ('t') will fill as many lines as needed, taking up to 70
characters per line.

The '-q' (QUIET) option, causes the date uploaded, and user uploading to be
suppressed. (Now, we all have those file areas that we don't want people to
know about, don't we? Some special GIFs or something? :)). Otherwise, it is
identical to the default listing.

The '-c' (COMPACT) options looks quite a bit different. The date and user
are still suppressed, but the formatting looks like this:

nnnn xxxxxxxxxxxxxxxxxx sssss ttttttttttttttttttttttttttttttttttttttttttttt
                              ttttttttttttttttttttttttttttttttttttttttttttt

where 'n' is still the file number, 'x' is the filename (NOTE: only 18
characters), 's' is the file size, and 't' is the text/comment. The size of
the file is handled differently: for files over 1K, the filesize is given
in terms of K (e.g., 10.4K). For files over 1M, the filesize is given in
terms of M (e.g., 1.24M). As many lines as needed will be used for the
text, with 45 characters per line.

COMPACT and QUIET are mutually exclusive.

Each file area is headed by the area number, and separated from others by a
line of '-'s.

As the building of the list is VERY disk intensive, DLGFileList reports a
completion status at the end of each file area (just so you know it hasn't
stopped working).


TECHNICAL INFORMATION:

DLGFileList works by reading the directory of each FILE: directory
specified. The '.fd' files are then sorted into numerical order, and the
necessary information is extracted from the '.fd' files and output to the
<outputfile>. The entire '.fd' file is read into memory and the appropriate
portions are re-formatted and output.

The File Area names are extracted from the file FILE:Area.bbs. ONLY the area
names are used from the record. If this file cannot be found, DLGFileList
will simply print the File Area number, and continue.

Memory allocation in DLGFileList is dynamic - with one exception. The
filenames array (on a per area basis) is fixed at 10KB. Should some user
have a problem with this size, I guess it can be increased. It should
handle over 1200 files though, and the overhead of making it capable of
storing 9999 files (or being dynamically allocated/built) was not very
palatable.

Due to the way DLG stores the required information, DLGFileList will
SEEM slow. But keep in mind that it is reading EVERY single '.fd' file in
EVERY file area specified in the parameters. The code is actually optimized
to minimize extraneous I/O's, and the processor usage is quite low.

An enhancement would be to specify the SIG name and then read the file area
list (and the SIG name) from the DLG control files. However, the format of
those files isn't public (as far as I know), and I didn't feel like
decoding the information in any more files (hey, if you want to do it, the
file is DLGConfig:SIGS/SIGS.File - let me know, okay? :) ).

Almost every possible error I could think of in DLGFileList is caught and
handled. Where recovery or re-tries are possible, I do so. The code should
be quite robust.

<<<>>>
