|
Packit |
fd8b60 |
# @(#)README 8.8 (Berkeley) 7/31/94
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
To build this portably, try something like:
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
make PORTDIR="../PORT/MACH"
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
where MACH is the machine, i.e. "sunos.4.1.1".
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
To run the tests, enter "sh run.test". If your system dictionary isn't
|
|
Packit |
fd8b60 |
in /usr/share/dict/words, edit run.test to reflect the correct place.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Fairly large files (the command files) are built in this directory during
|
|
Packit |
fd8b60 |
the test runs, and even larger files (the database files) are created in
|
|
Packit |
fd8b60 |
"/var/tmp". If the latter directory doesn't exist, set the environmental
|
|
Packit |
fd8b60 |
variable TMPDIR to a directory where the files can be built.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
Packit |
fd8b60 |
The script file consists of lines with an initial character which is
|
|
Packit |
fd8b60 |
the command for that line, or an initial character indicating a key
|
|
Packit |
fd8b60 |
or data entry for a previous command.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Legal command characters are as follows:
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
c: compare a record
|
|
Packit |
fd8b60 |
+ must be followed by [kK][dD]; the data value in the database
|
|
Packit |
fd8b60 |
associated with the specified key is compared to the specified
|
|
Packit |
fd8b60 |
data value.
|
|
Packit |
fd8b60 |
e: echo a string
|
|
Packit |
fd8b60 |
+ writes out the rest of the line into the output file; if the
|
|
Packit |
fd8b60 |
last character is not a carriage-return, a newline is appended.
|
|
Packit |
fd8b60 |
f: set the flags for the next command
|
|
Packit |
fd8b60 |
+ no value zero's the flags
|
|
Packit |
fd8b60 |
g: do a get command
|
|
Packit |
fd8b60 |
+ must be followed by [kK]
|
|
Packit |
fd8b60 |
+ writes out the retrieved data DBT.
|
|
Packit |
fd8b60 |
o [r]: dump [reverse]
|
|
Packit |
fd8b60 |
+ dump the database out, if 'r' is set, in reverse order.
|
|
Packit |
fd8b60 |
p: do a put command
|
|
Packit |
fd8b60 |
+ must be followed by [kK][dD]
|
|
Packit |
fd8b60 |
r: do a del command
|
|
Packit |
fd8b60 |
+ must be followed by [kK] unless R_CURSOR flag set.
|
|
Packit |
fd8b60 |
S: sync the database
|
|
Packit |
fd8b60 |
s: do a seq command
|
|
Packit |
fd8b60 |
+ must be followed by [kK] if R_CURSOR flag set.
|
|
Packit |
fd8b60 |
+ writes out the retrieved data DBT.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Legal key/data characters are as follows:
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
D [file]: data file
|
|
Packit |
fd8b60 |
+ set the current data value to the contents of the file
|
|
Packit |
fd8b60 |
d [data]:
|
|
Packit |
fd8b60 |
+ set the current key value to the contents of the line.
|
|
Packit |
fd8b60 |
K [file]: key file
|
|
Packit |
fd8b60 |
+ set the current key value to the contents of the file
|
|
Packit |
fd8b60 |
k [data]:
|
|
Packit |
fd8b60 |
+ set the current key value to the contents of the line.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Blank lines, lines with leading white space, and lines with leading
|
|
Packit |
fd8b60 |
hash marks (#) are ignored.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Options to dbtest are as follows:
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
-d: Set the DB_LOCK flag.
|
|
Packit |
fd8b60 |
-f: Use the file argument as the database file.
|
|
Packit |
fd8b60 |
-i: Use the rest of the argument to set elements in the info
|
|
Packit |
fd8b60 |
structure. If the type is btree, then "-i cachesize=10240"
|
|
Packit |
fd8b60 |
will set BTREEINFO.cachesize to 10240.
|
|
Packit |
fd8b60 |
-o: The rest of the argument is the output file instead of
|
|
Packit |
fd8b60 |
using stdout.
|
|
Packit |
fd8b60 |
-s: Don't delete the database file before opening it, i.e.
|
|
Packit |
fd8b60 |
use the database file from a previous run.
|
|
Packit |
fd8b60 |
|
|
Packit |
fd8b60 |
Dbtest requires two arguments, the type of access "hash", "recno"
|
|
Packit |
fd8b60 |
or "btree", and the script name or "-" to indicate stdin.
|