FDB 1.4 - Documentation
***********************

Copyright
*********

   FDB (C) 1993-95 kMel, Klaus Melchior

   These programs are freely distributable, but copyrighted by me. This
means you may freely copy it as long as you do not charge more than a
nominal fee for copying. These programs may be put on PD disks,
especially on Fred Fish's CDROMs, Meeting Pearls CDs or other cheap
CDROMs. If you want to distribute this program you MUST keep this
document with it. The program and the documents must be distributed in
their original unmodified form.

   These programs cannot be used for commercial purposes without written
permission by the author. The author can not be made responsible for
any damage which is caused by using these programs.


-----------------------------------------------------------------------
These programs are GiftWare. If you like them and use them regularly,
you should consider to send a small donation to the author in order to
honor the work he has put into these programs.
-----------------------------------------------------------------------

   Send comments, suggestions or bug reports, and the gifts to:

     Klaus Melchior, Schulstrasse 17
     D-52156 Monschau, Germany
     Phone: +49 (0)2472 4710
     
     DE:   kmel@eifel.tng.oche.de
     BIG:  kmel@et1.etechnik.fh-aachen.de
     ADSP: kmel@eifel.adsp.sub.org
     FIDO: 2:242/158.2@fidonet
     FIDO: 242:3001/100.2@fido.de

Changes
*******

   Changes since 1.3:

   * path where to find the databases is defineable, but default is
     'FindDB:'

   * size of buffer when loading a database is defineable, databases
     can be loaded in parts

   * FDB with faster search routine

   * database path, buffer size & options can be stored in an
     environment variable

   * new programm: CDB, to convert databases into ASCII and vice versa

   * avoid files during the UDB scan

   * LDB lists files matching a pattern

   * memory pools

   * bugs fixed

What is FDB?
************

   FDB & UDB are based on find/updatedb-utilities from Larry Phillips
and Martin Steppler. If you already have installed them it is easy to
use my tools, because they are compatible. I use the same kind of
database.

   LDB & CDB are new programs, which can be used to change the
databases.

What is UDB?
************

   UDB generates a database in a path you can specify, default is
"FindDB:", which you must first assign to some place on your harddisk.
It scans all directories and files specified in the file
"FindDB:<db>.config". This file must contain only one line; pathnames
are separated by spaces, e.g.:

     Filename                Contents
     ------------------      -----------------------
     FindDB:find.config  ->  Work: Sys:
     FindDB:test.config  ->  RAM:
     FindDB:<db>.config  ->  <path> <path> ...

   To avoid paths you can define a 'AP=AvoidPaths' pattern in this line.
You only have to set a '~' (tilde) at the begin of the pattern. There
should be only one 'AvoidPaths' pattern in the line.

   If you would scan the "S:" and the "man:" directory, without all
"guide" drawers, generate following line:

     Filename                 Contents
     -------------------      ----------------------
     FindDB:test2.config  ->  S: ~(#?guide/) man:

   To avoid files you can define a 'AF=AvoidFiles' pattern in this line.
You only have to set a '!' at the begin of the pattern. There should be
only one in the line, too.

   If you would scan the GoldFish-CDROM without all the "disk.info"s,
generate following config line:

     Filename                 Contents
     -------------------      ----------------------
     FindDB:test3.config  ->  CD0: !disk.info

   <db> is the name of the database. So you can have several databases
in your "FindDB:", e.g. one of the last Fish-CD, one of all your
Sources, ... . Default of <db> is "find", like Larry's find.

   Furhermore, udb provides scanning of several paths without having to
create a <db>.config file.  You can simply specify the paths in the
command line, e.g.:

     udb db test RAM: SYS:

   This leads to the consecutive scanning of "RAM:" and "SYS:".  The
names of all files and dirs are stored in the database "test".

What is FDB?
************

   FDB finds quickly files/dirs by using these databases.

   If your are looking for a file on an already scanned CDROM, you only
have to specify the name of the database and the filename, e.g. you
want to locate 'ToolManager' on the third 'FreshFish'-CDROM:

     fdb db fresh03 ToolManager

   If you don't know where to find 'ToolManager' in your databases,
select all databases while typing:

     fdb db #? ToolManager

   If you don't have enough memory to load the whole database, you can
specify the size of the buffer in depend on our free memory.

     fdb ToolManager db gold1 bs 100000

What is LDB?
************

   LDB lists the files/dirs in the specified database. If you don't want
to see all the entries, specify a pattern.

     ldb find p #?.a

What is CDB?
************

   CDB converts the specified database into a plain ASCII file, which
you can edit and then re-convert it. This can also be used to convert
simple 'tar' lists into a FDB database.

     cdb ImportASCII TarLists:backup_001.lst DB backup1

CLI arguments
*************

   These are the options/arguments, which the following programm can be
started from CLI/shell.

UDB arguments
*************

Paths/M
     paths to scan. If no paths are specified, <db>.config is used

DB=DataBase/K
     specify a database, default is "find"

DBP=DBPath/K
     here you can define a path where the databases are stored

AP=AvoidPaths/K
     specify a pattern, which _expanded_ paths should not be scanned,
     e.g.: use "#?guide/" to avoid the "3.x:s/guide/" path

AF=AvoidFiles/K
     define a pattern, which files should not be stored in the database,
     e.g.: use "#?.info" to avoid all icons

V=Verbose/S
     while scanning through the database the momentary path is displayed

FDB arguments
*************

P=Pattern/A
     amiga-pattern, is used between two "#?", so a pattern like "foo" is
     really "#?foo#?", seen at Larry's find.

DB=DataBase/K
     specify a database, default is "find"; if here a pattern is used,
     FDB look into "FindDB:" and if the pattern match, these databases
     are scanned.

DBP=DBPath/K
     here you can define a path where the databases are read

E=Exact/S
     the pattern at 'P=Pattern/A' is used exactly the way you specified
     it and is not expanded to "#?<pattern>#?".

CS=CaseSensitive/S
     the pattern is handled casesensitive

D=Dirs/S
     only show directories

F=Files/S
     only show files

NH=NoHead/S
     no headers are displayed, entries are not sorted

NP=NoPath/S
     no absolute pathnames are displayed

PG=Pages/S
     the output is handled in pages, 'return' to continue, other key &
     'return' to break

BS=BufferSize/K/N
     define the size of the buffer the databases are loaded in, at least
     2048 bytes

LDB arguments
*************

DB=DataBase/K
     specify a database, default is "find"

DBP=DBPath/K
     here you can define a path where the databases are read

P=Pattern/K
     define the pattern, which is used for matching the entries while
     output

CDB arguments
*************

C=Command/A
     these are the available commands you have to specify here

    IA=ImportASCII
          the ASCII file is imported into the specified database

    EA=ExportASCII
          the specified database is exported as ASCII file

F=File/A
     specify the file

DB=DataBase/K/A
     specify a database, default is "find"

DBP=DBPath/K
     here you can define a path where the databases are read

P=Pattern/K
     define the pattern, which is used for matching the entries while
     converting

Arguments often used
********************

   The preferenes file is stored at "ENV:FDB.prefs".

     ; Preferences for FDB, UDB, LDB and CDB
     
     DBPath finddb:
     ;BufferSize 50000
     
     ;FDB NoHead
     FDB Pages
     
     UDB Verbose

   Every valid line must have two words seperated by a space. Every
argument in a single line. A ';' in front marks the line as comment.

   This data is global for all programs:

   - DBPath <path>

   - BufferSize <size in bytes>

   This is the known keyword for UDB:

   - UDB Verbose

   FDB knows these:

   - FDB CaseSensitive

   - FDB Exact

   - FDB NoHead

   - FDB NoPath

   - FDB Pages

What you need !
***************

   - Kickstart >= 2.0

   - Workbench >= 2.0

How to install!
***************

   You could create a drawer like "FindDB" and set an assign "FindDB:"
on it. All tools of FDB are requiring this assign, so you have to create
it. Every of the <db>.config and <db>.codes files are stored there.

   So you should create these lines in your "user-startup" like this:

     BEGIN FindDB
     "assign FindDB: Work:finddb/"
     END FindDB

   If you don't want this assign, use the argument "DBPath", here you an
define where to put/get the databases. This path can be stored in the
preferenes (see Preferences).

   All arguments (see Arguments) can be stored in the preferenes (see
Preferences), too.

   Copy the "bin/" files to a place where you already have a path on,
normally this is "C:" or "bin:".

     copy bin/#? C:

   The example preferences file can be copied to 'ENV:'.

     copy env/#? ENV:

This is limited!
****************

UDB
===

   - commandline in "<db>.config" is limited to 1023 bytes, only one
     line

FDB
===

   - found path & filename are limited to 1023 characters

LDB
===

   - path & filename are limited to 1023 characters

History of FDB
**************

      1.0  12.12.93  * first public release
     
           31.12.93  + FDB: added 'P=PAGES' mode
      1.1            * private release
     
           07.02.94  + FDB: rewrote find routine in assembler
     
           08.02.94  + FDB: mode 'E=EXACT': locating with "MatchPattern"
                     - FDB: corrected bug, break wasn't recognized at
                            startup (Andreas Harrenberg)
                     - FDB: corrected template & doc, 'NH=NoHead'
                            (Gottfried Janik)
                     - FDB: corrected bug, break at mode 'P=PAGES' was
                            recognized too late
     
           09.02.94  - doc corrected (Martin Steppler)
                     - UDB: corrected bug, break wasn't recognized at
                            startup (Andreas Harrenberg)
     
      1.2  10.02.94  * release
     
           03.03.94  - FDB: corrected bug with ReadArgs()
                     - UDB: corrected bug with ReadArgs()
     
           08.03.94  + UDB: rearranged source for better error handling
                     + UDB: added option 'AP=AvoidPaths', a pattern of paths
                            not to scan (Thomas Kobler)
                     > LDB: created
     
           19.03.94  + doc rewritten in texinfo
                     + release contains now doc & guide file
     
           21.03.94  > german documentation
                     + FDB: now 'DB=DataBase/K' can contain a pattern to
                            select several databases (a spezi from bavaria)
     
           25.03.94  - german doc corrected (Andreas Harrenberg)
                     - LDB: 'DB=DataBase/K' changed into 'DB=DataBase/A'
                            (Andreas Harrenberg)
                     + UDB: 'AP=AvoidPaths' could also be set in the
                            <db>.config (Andreas Harrenberg)
     
           27.03.94  - doc corrections (Martin Steppler)
     
      1.3  30.03.94  * release
     
           16.09.94  + UDB: 'AF=AvoidFiles', a pattern of files not to scan
                            (Gottfried Janik)
                     + UDB: 'AF=AvoidFiles' could also be set in the
                            <db>.config
     
           12.07.95  + FDB: assembler search routine, speed increased
                     + documentation changed
                     - UDB: bug in AvoidPaths/Files recognition routine
                            fixed
                     + memory pools used
                     - UDB: eats memory if breaking the scan, fixed
     
           14.07.95  + FDB: ENV:fdb.prefs (Ibi)
                     + FDB: DB=DBPath/K, path of databases
                     + documentation changed
     
           15.07.95  + german documentation adapted
                     + UDB: DB=DBPath/K, path of databases
                     + LDB: DB=DBPath/K, path of databases
     
           16.07.95  + FDB: BS=BufferSize/K/N, size of the buffer loading in
                            a database (Khamsonh M. Khounlivong)
                     - FDB: bug in breaking find routine with BufferSize
                            (Gottfried Janik)
                     + UDB: V=Verbose/S (Khamsonh M. Khounlivong)
     
           17.07.95  + find routines rewritten, faster
       b1            * beta release
                     + LDB: P=PATTERN/K, lists only files matching this
                            pattern (Andreas Harrenberg)
       b2            * beta release
                     - LDB: now DB=DataBase instead of DB=DataBase/A
                     + support of FlexIcons
     
       b3  19.07.95  * beta release
     
           27.07.95  > CDB: created (Henning Hucke)
                     + CDB: command IA=ImportAscii
                     + CDB: command EA=ExportAscii
                     * CDB: beta release to Henning Hucke
     
       b4  28.07.95  * beta release
     
           07.08.95  + documents changed for TexInfoMake
     
           13.08.95  + more document changes for TexInfoMake
                     + UDB: change VERBOSE/S output (Khamsonh M.
                            Khounlivong)
                     + CDB: version bumped to 1.0
     
           07.09.95  + FDB: xpk support added [Angela Schmidt]
                     + FDB: checks database file contents
       b5            * beta release
     
           16.09.95  - FDB: xpk support removed
      1.4            * release

What is to do in future?
************************

   - UDB: switch "Append/S"

   - FDB: NoHead/K, working 'Dirs'/'Files'

   - UDB: softlinks

   - FDB: sorted lists

   - MDB: MUI-Application, rearrange the databases

   - UDB: Option, not to use a temporary file while scanning UDB:
     Option, daß die temporäre Datei während des Durchsuchens nicht
     benutzt wird

   - LDB: use BufferSize/K

   - define a extended database format to store name, size, date

   - CDB: import AmiBack index files

   - locale support

   - installer script

Example databases
*****************

   You can find several CDRom databases on Aminet: "FDB_Data.lha",
"FDB_Data2.lha", ... and many of them on the "Meeting Pearls"-CDRoms,
so these are the databases of the "Meeting Pearls II"-CD:

     17BitA 17BitB amazing aminet1 aminet2 aminet3 aminet4 aplus cats2
     CDexchange1 demo2 DESKTOPLIB1 euroscene1 fresh1 fresh1_virus fresh2
     fresh3 fresh4 fresh5 fresh6 fresh7 freshfonts1 gold1 gold2 megahits1
     NetworkCD pandoras pearls1 saar1 saar2 SoundsTerrific1_2
     SoundsTerrific2_2 SourceCodeCDROM_0392 update1 X11R5_GNU_CDROM1292

   For example, if you are looking for FindPearls on the "Meeting Pearls
II"-CD, you only have to type in following line:

     fdb findpearls db pearls2

   And this is the answer FDB gives you:

     Directories
     -----------
     Meeting_Pearls_II:Contrib/FindPearls/
     Meeting_Pearls_II:Contrib/FindPearls/Contrib/
     Meeting_Pearls_II:Contrib/FindPearls/Catalogs/
     Meeting_Pearls_II:Contrib/FindPearls/Catalogs/français/
     Meeting_Pearls_II:Contrib/FindPearls/Catalogs/deutsch/
     
     
     Files
     -----
     Meeting_Pearls_II:FindPearls.info
     Meeting_Pearls_II:FindPearls
     Meeting_Pearls_II:SYS/S/FindPearls.config
     Meeting_Pearls_II:SYS/S/FindPearls.prefs
     Meeting_Pearls_II:Index/FindPearlsDB
     Meeting_Pearls_II:Contrib/FindPearls.info
     Meeting_Pearls_II:Contrib/FindPearls/FindPearls.deu.guide.info
     Meeting_Pearls_II:Contrib/FindPearls/FindPearls.deu.guide
     Meeting_Pearls_II:Contrib/FindPearls/FindPearls.guide.info
     Meeting_Pearls_II:Contrib/FindPearls/FindPearls.guide
     Meeting_Pearls_II:Contrib/FindPearls/FindPearls.info
     Meeting_Pearls_II:Contrib/FindPearls/FindPearls
     Meeting_Pearls_II:Contrib/FindPearls/Contrib/FindPearls.cd
     Meeting_Pearls_II:Contrib/FindPearls/Contrib/FindPearls_D.ct
     Meeting_Pearls_II:Contrib/FindPearls/Contrib/FindPearls_F.ct
     Meeting_Pearls_II:Contrib/FindPearls/Catalogs/français/FindPearls.catalog
     Meeting_Pearls_II:Contrib/FindPearls/Catalogs/deutsch/FindPearls.catalog

   To create databases of your own CDROMs, generate first a .config file
with the real volume name of the CD, not only "CD0:". Furthermore there
should be more lines with the name of the CD, the copyright and the
manufactor, or other related comments.

     "Meeting Pearls II:" ~(#?:SetAttribDir|#?:T)
     
     Meeting Pearls, Ausgabe II
     (c) 1995 Angela Schmidt
     Stefan Ossowskis Schatztruhe

Thanks are going to ...
***********************

   - Martin Steppler, Andreas Harrenberg for testing & doc-corrections

   - Stefan Becker for his TM.texi, Stefan Stuntz, Ibi

   - Gottfried Janik for testing

   - Joerg Gutzke, Thomas Kobler, Dirk Ludwig, Henning Hucke

   - Angela Schmidt, Khamsonh M. Khounlivong for supporting FDB
     databases on the "Meeting Pearls"-CDs

   - and all I forgot to mention ...

Index
*****



 Arguments                              Arguments
 assign                                 Installation
 Authors address                        Copyright
 Bug reports                            Copyright
 CDB                                    desc_CDB
 CDB arguments                          args_CDB
 Changes                                Changes
 CLI arguments                          Arguments
 Comments                               Copyright
 Copyright                              Copyright
 Credits                                Credits
 Description                            Description
 Distribution                           Copyright
 E-Mail                                 Copyright
 ENV variable                           Installation
 Example databases                      Examples
 Examples                               Examples
 FDB                                    desc_FDB
 FDB arguments                          args_FDB
 FindBD:                                Installation
 GiftWare                               Copyright
 History                                History
 Installation                           Installation
 LDB                                    desc_LDB
 LDB arguments                          args_LDB
 Limitations                            Limitations
 Preferences                            Preferences
 Requirements                           Requirements
 Thanks                                 Credits
 ToDo                                   ToDo
 UDB                                    desc_UDB
 UDB arguments                          args_UDB

