mklinks(1) UNIX Programmer's Manual mklinks(1)
NAME
mklinks - populate the sandbox with links to files in a
backing tree.
SYNOPSIS
mklinks [-copy -norecurse -delete] [gen opts] [sb opts]
directory | [abs opts]
gen opts:
-v -info -auto
sb opts: -sb sandbox -rc usr_rc_file
abs opts:
-link_from source-directory -link_to new-directory
-cmp -query
mklinks -usage
FLAGS
-copy
Make actual copies rather than links. The modification
times of the files that are copied are preserved for
the benefit of make.
-norecurse
Does not recurse down through the directory; only links
files in the target directory.
-delete
This flag is implemented yet.
gen opts:
-v List each action taken. This is flag gives debugging
information.
-info
Indicates which directories will be linked without
actually linking them.
-auto
Begin making links without prompting the user to start.
sb opts:
-sb sandbox
Use sandbox as the sandbox name. The default value of
this flag is the value of $SANDBOX or the default sand-
box name listed in $HOME/.sandboxrc file.
-rc user_rc_file
Printed 1/23/91 5/7/90 1
mklinks(1) UNIX Programmer's Manual mklinks(1)
Provides the path and name of an alternative rc file to
use instead of the default ${HOME}/.sandboxrc.
abs opts:
-link_from source-directory
Use source-directory as the path of the directory to
make links from. This is for general functionality of
the tool and is not normally used in sandboxes.
-link_to new-directory
Use new-directory as the path to the directory to con-
tain the new links. This is for general functionality
of the tool and is not normally used in sandboxes.
-cmp In a previously created linked sandbox, compare and
link identical files.
-query
Used with the -cmp flag, query the user for each file
to be deleted and relinked.
-usage
Print the a brief usage message.
mklinks provides a quick and easy way to link or copy direc-
tories recursively. By default it knows about the sandbox
structure puts links in place using that knowledge.
DESCRIPTION
The mklinks command recursively creates symbolic links from
files in a specified subdirectory of the sandbox, (direc-
tory), to the directory that the sandbox is backed by. (In
the OSF/1 build environment, the backing tree is found
through the link subdirectory of the sandbox so that the
symbolic links will still be functional if the user changes
backing trees.)
If the directory given to mklinks starts with a slash, "/",
the full path of the directory to link will be created by
concatenating the name of the sandbox directory, the sandbox
name, and the directory. If the directory does not begin
with a slash, it is assumed to be relative to the current
working directory. If the current directory is not in the
sandbox, mklinks will print an error.
The directory to link from (the directory in the backing
tree) must already exist. If, however, the directory to
link to in the sandbox does not exist, it will be created.
Options which apply to creating links in a sandbox are:
-copy, -norecurse, -v, -auto, and -info.
Printed 1/23/91 5/7/90 2
mklinks(1) UNIX Programmer's Manual mklinks(1)
If, instead of automatically linking a sandbox with its
backing tree, the user wishes to link two arbitrary direc-
tories, he can do so by using the -link_from and -link_to
options together. These two options are used as a pair and
the directory entry given with sandbox linking is omitted.
mklinks will return an error if only one of these options is
given.
Each option is followed by the absolute or relative path to
the appropriate directory. If the directory path is abso-
lute (starts with a slash) it is taken from the root. If it
does not start with a slash, it is assumed to begin at the
current working directory.
These two options can be used in conjunction with all the
option previously mentioned plus -cmp and -query.
In a sandbox that already contains some links, mklinks will
add any new links required. With the -cmp and -query
options, mklinks can check or update sandboxes that already
contain some links.
mklinks uses the standard sandbox options -sb and -rc to
change the name of the sandbox or the user's rc file.
EXAMPLES
For purposes of these examples, the sandbox is assumed to be
/sandbox/suzieq/song.
mklinks /src/usr/bin/yacc
Links all files and directories, recursively, from
/sandbox/suzieq/song/link/src/usr/bin/yacc to
/sandbox/suzieq/song/src/usr/bin/yacc. It does not matter
where the current working directory is when this command is
called.
The same result is achieved with these commands:
cd /sandbox/suzieq/song/src/usr/bin/yacc
mklinks .
When a relative path is given, mklinks expects the user to
be in the sandbox.
If the links are to be created in other than the current
sandbox, use the -sb flag:
mklinks -sb /sandbox/suzieq/memories /src/usr/bin/yacc
The -norecurse option stops mklinks from linking sub-
directories. To link the objects in kernel/bin without
Printed 1/23/91 5/7/90 3
mklinks(1) UNIX Programmer's Manual mklinks(1)
descending the sub-directories, the command would be:
mklinks -norecurse /obj/pmax/kernel/bin
To make local copies of the tools, use:
mklinks -copy /tools
To link two arbitrary directories, for example the src in
someone's sandbox to the user's home directory, use the
-link_ options.
mklinks -link_from /sandbox/suzieq/song/src -link_to
~/src
These two options must always be used together.
FILES
$HOME/.sandboxrc
is used to obtain the path to the sandbox.
sandbox/link
is the directory through which mklinks access the back-
ing tree.
RELATED INFORMATION
sandboxrc(4), mksb(1), resb(1), sandbox(5)
PLANNED ENHANCEMENTS
The flag -delete will be added. In a previously created
linked sandbox, mklinks -delete will delete links for files
that have disappeared from the backing tree as well as
create the new links required. mklinks -delete -query will
query the user before deleting the obsolete links from the
sandbox. mklinks -delete -info will check a previously
linked sandbox for consistency with the backing tree and
report any files that are missing from the backing tree
without actually performing the deletions.
The -info option will list the individual files in the back-
ing tree which would be linked without actually doing the
work. The option will also check a previously linked sand-
box for consistency with the backing tree and list any files
in the backing tree which do not have links.
Printed 1/23/91 5/7/90 4