NAME
pt - pairtree manipulation commands
SYNOPSIS
- pt [-d dir] [mktree] directory [prefix]
- pt [-l] [-d dir] [rmtree | lstree] [directory] ...
- pt [-d dir] [mknode | rmnode | lsnode] id ...
- pt [i2p | p2i] name ...
DESCRIPTION
The pt command introduces (sub)commands that can be used to create, delete, modify, and report on a pairtree. When not made explicit via an argument (see the first two forms above), the pairtree in question is assumed to reside in a pairtree_root/ directory descending from the current directory or from a directory specified with -d.
The first form creates a pairtree, recording an optional prefix that will be stripped from an identifier before mapping it to a pairpath and prepended to an identifier generated from a pairpath.
The second form deletes or lists an entire tree of nodes and the third form creates, deletes, or tests the existence of an identifier via its corresponding pairpath filesystem directory node. At the end of each pairpath, mknode will create a bud directory to encapsulate each leaf of the tree. By default, the bud directory name will be taken from the full form of the identifier.
While a pairpath may have any length, to properly encapsulate a leaf, there must be one and only one bud, and its name must be more than two characters long. An identifier shorter than that requires padding the bud name on the left with `0' (zero), except for an empty identifier, when the bud name simply becomes "supernode".
If -l is also given for lstree, the number of octets and files is listed after each identifier.
The fourth form permits access to the purely lexical lower level conversion between identifiers and pairpaths, ndependent of any existing pairtree.
This alpha-level software has not been extensively tested.
EXAMPLES
$ pt mknode foo bar zafp
./pairtree_root/fo/o/foo
./pairtree_root/ba/r/bar
./pairtree_root/za/fp/zafp
$ pt rmnode bar
removed: bar | ./pairtree_root/ba/r/
$ touch ./pairtree_root/za/fp/zafp/{a,b,c}
$ pt lstree -l
Id Oxum
zafp 0.3
foo 0.0
2 objects
$ pt mknode ab c ''
./pairtree_root/ab/0ab
./pairtree_root/c/00c
./pairtree_root/supernode
OPTIONS
- -d directory
-
Specify pairtree directory. A "pairtree_root" component will be added on if not already present in directory.
- -h, --help
-
Print extended help documentation.
- -l, --long
-
Print more detailed listings.
- --man
-
Print full documentation.
- --version
-
Print the current version number and exit.
- -bmfa
-
Options yet to come, for --bud, --format, --force, --all.
SEE ALSO
touch(1)
AUTHOR
John Kunze jak at ucop dot edu
COPYRIGHT
Copyright 2009 UC Regents. Open source Apache License, Version 2.