
-
Some time back, someone posted a program called 'kb', a quick keyed
database manager.  I looked it over and tried to use it, but found it
rather awkward and non-intuitive.  This is my first attempt at this
problem, called 'kd'.  (short, home-row, and vaguely 'keyed database.'
Essentially, it allows you to enter, index, query, and delete text
files using one or more keys.  I use it to store ideas, phone messages,
my current calendar, lists of things I have to do, and other things which
are too easily lost when just written down.  For instance, my calendar
file has the keys 'calendar' and 'events', so I say 'kd -Q events' or
'kd -Q calendar' to look at it, and 'kd -e events' or 'kd -e calendar' to
edit it.  If I want to see what's cooking with a particular vendor that
I am dealing with (like phone number of rep, verbal specifications), I
say 'kd -Q vendor', or just 'kd -x vendor' for a list of entries with
all the other keywords.

Advantages of kd:
	'friendly' user interface
	single program
	allows simple editing of text and keywords
	fairly 'robust' database-- key file can be fully reconstructed from
	  data files, all ASCII files with obvious format

Disadvantages of kd:
	only does 'AND' keyword search (I haven't found this to be a
	  significant limitation yet)
	requires explicit specification of keywords (in some ways a bonus,
	  since you don't get keys you didn't want and you always get the
	  ones you thought you were going to get)
	not excruciatingly fast (but neither was kb, for that matter)

To install, unroll the shar file using /bin/sh, modify the first line
of the Makefile to match your home directory, and type:
	make			(compiles kd)
	make initialize		(makes null key file and data file directory)

As currently written, kd will create a file called .keys in your home
directory and a subdirectory called .kd in your home directory.  Each
entry is a separate file in .kd.  When editing a new entry, it creates a
temporary file in /tmp.  The program uses the <sys/dir.h> directory functions,
which I believe are BSD 4.1c and beyond-specific.  It should be fairly
straightforward to construct equivalent functions for other Unixes.  It also
refers to "/usr/ucb/vi" explicitly.  If you prefer a different editor, or your
vi is located elsewhere, you should change these occurrences.  Yes, I know
I should have checked getenv("EDITOR"), but I didn't.

Usage is explained in the header comment of kd.c, and most of this
information is given when kd is invoked with no arguments.  No attempts
have been made to instill great robustness to the program, but it has
behaved fairly well so far for me.  I would appreciate any bugs, fixes or
improvements (since some of you undoubtedly have more time than me for
dabbling in these things *sigh*).  Thanks and have fun.

	Mark Papamarcos
	Valid Logic
	hplabs!ridge!valid!markp

(no warranty, either express or implied, and all that other legal stuff--
 if you use this program to maintain anything important, BACKUP YOUR
 DATABASE OCCASIONALLY!-- simply copying the .kd directory to somewhere
 else is sufficient)

