BTREEOP(1)

NAME
btreeop - btree database maintenance tool

SYNOPSIS
btreeop [-A] [-C] [-D key] [-K key] [-b] [-c cashesize] [-l] [-p psize] [dbname]

DESCRIPTION
Btreeop execute simple operations for btree(3) database. Btreeop can create database, write record, read record (sequential or index) and delete record from it. Duplicate entries are allowed.

OPTIONS
A capital letter means a command. If no command specified then it assume sequential read operation.

-A  append records. If database doesn't exist, btreeop creates it.

-C  create database and write records to it.

-D key
    delete records by the key.

-K key
    search records by the key.

-b  assume BIG_ENDIAN byte order. default is LITTLE_ENDIAN.

-c cashesize
    specify cashesize. It's identical to info.cachesize of BTREEINFO. (see btree(3))

-l  assume LITTLE_ENDIAN byte order. (the default)

-p psize
    specify page size. It's identical to info.psize of BTREEINFO. (see btree(3))

dbname
    database name. default is 'btree'.

DATA FORMAT
To creat (or append) database, btreeop read data from stdin. The format of the data is the following. Key Data\n Key Data\n . . .

1.  Key and Data are separated by blank('\t' or ' ').

2.  Key cannot include blank.

3.  Data can include blank.

4.  Null Data not allowed.

5.  Additionally, META record is available. META record has a key that start with a blank. You can read this record only by indexed search (with -K option). Usage is unlimited by Btreeop.

EXAMPLES
Create database. % btreeop -C key1 data1 key2 data2 key3 data3 ^D % Append records. % btreeop -A __.VERSION 2 key2 data2-2 ^D % Sequential read. % btreeop key2 data2 key3 data3 key2 data2-2 key1 data1 % Indexed read. % btreeop -K key2 key2 data2-2 key2 data2 % btreeop -K ' __.VERSION' __.VERSION 2 % Delete record. % btreeop -D ' __.VERSION' % btreeop -K ' __.VERSION' %

FILES
btree
    default database name.

DIAGNOSTICS
Btreeop exits with a value of 1 if an error occurred, 0 otherwise.

SEE ALSO
btree(3)

AUTHOR
Shigio Yamaguchi (shigio@wafu.netgate.net)

HISTORY
The btreeop command appeared in FreeBSD 2.2.