TLINK(1) TLINK(1)
tlink - clone a file tree using symbolic links
tlink [-chnprvX] [-dpattern] [-xpattern] source target [path...]
Tlink creates a directory tree rooted at target identical to the
directory tree rooted at source, populating the directories in the target
tree with symbolic links to corresponding files under the source tree.
If optional paths are supplied after source and target, only the subtrees
named by concatenating each path with source are linked under
target.
The -c (clean) option causes tlink to walk the target tree removing any
directory which lacks a counterpart in the source tree, any symbolic link
which does not name its non-directory counterpart in the source tree, and
any file which is not a directory or a link.
The -d option symbolically links a directory in the source tree into the
corresponding place in the target tree. The link's pathname must match
the regular expression given by pattern. Regular expressions are as
described in regcmp(3X). When used with -c, this option prevents tlink
from cleaning symbolic links to source directories.
The -h option creates hard rather than symbolic links, to conserve inodes
and disk blocks in a filesystem. A hard-linked tree has the drawback
that a file linked in it may become stale (i.e. diverge from its
prototype source node) if its source is unlinked and recreated, whereas a
symbolic link to the source always denotes the same pathname, whether or
not the source exists. This option fails if source and target are
directories in different filesystems.
The -n option causes tlink to operate without actually constructing a
target tree. With this option, tlink will traverse the source tree,
formulating pathnames, changing current directory, and calling stat(2) on
source files.
The -p (prune) option causes tlink to remove symbolic links to nonexistent
source pathnames from the target tree. Prior tlink invocations
may have created links to source files that no longer exist, and also
directories containing only links to obsolete source; tlink -p prunes
such deadwood.
To create relative rather than absolute symbolic links, use the -r
option. Tlink relates targets to sources by computing the path up from
each target to the closest ancestor directory common to source and
target, and appending the source path down from this ancestor.
The -v (verbose) option prints the name of each directory and symbolic
link created (or removed with the -c option). If a non-directory file
exists in the target tree and its source file is a directory, tlink -v
Page 1
TLINK(1) TLINK(1)
prints the target's pathname and ``Not a directory.'' If a directory in
the target tree has a non-directory source, verbose tlink prints the
target's pathname and ``Is a directory.'' If a symbolic link in the
target tree names no existent file, then tlink will attempt to unlink the
stale link. Upon successful removal, verbose tlink will print the
target's pathname and ``No such file or directory.''
The -x option adds pattern to a list of regular expression describing
filenames to be excluded from the tree walk. The list's initial contents
are:
^\.{1,2}$
^RCS$
^.*,v$
If pattern contains slashes, then tlink matches full pathnames rather
than filenames against the expression. Specifying -X eliminates all but
the first of the above expressions from the exclusion list.
Brendan Eich, 01/14/87
stat(2), regexp(3X).
PPPPaaaaggggeeee 2222 [ Back ]
|