.\" @(#)cd←link.1 1.00 91/04/05 Copyright 1990, 1991 By Young Minds, Incorporated
.nh
.TH CD←LINK 1  "5 April 1991"
.SH NAME
cd←link \- make symbolic links to CD-ROM files
.SH SYNOPSIS
.B cd←link
[
.B \-rR
]
.IB cdrom←directory
[
.IB target←directory
]
.SH DESCRIPTION

.B cd←link
creates a set of symbolic links in the
.IB target←directory
to the files/directories stored on a CD-ROM created by Young Minds'
CD-ROM Publishing Software.  The program uses the
.IB cdrom←directory
to search for a
translation file (normally
.BR YMTRANS.TBL).
If found, the program uses the file to build a set of symbolic
links in the
.IB target←directory
to the files (and directories, if the
.B -r
option is given) in the
.IB cdrom←directory.
If the
.IB target←directory
is not specified on the command line, the symbolic
links are built in the current working directory.

The names given to the links in the
.IB target←directory
are the original UNIX\(dg
names that the files on the CD-ROM had before they were formatted
to conform to the
.B ISO9660
specification.  This gives you the ability to use
the files on the CD-ROM as they were originally intended to be used
under a UNIX\(dg
filesystem.  For example, if you had a source distribution on CD-ROM,
you could use
.B cd←link
to build the original UNIX\(dg
names in a writable partition in order to make the executables.

Since it is often desirable to have the original UNIX\(dg
names in a writable partition, 
.B cd←link
will also build links for a
.B Rock Ridge
disc.

.SH OPTIONS
.TP
.B \-r
Recursively descend the subdirectory rooted at
.IB cdrom←directory.
.TP
.B \-R
Make links to a disc mounted with a
.B Rock Ridge
filesystem driver.

.SH EXAMPLE

The example below shows how to create the symbolic links necessary
to recreate the directory tree for gnuplot in the directory
/cd-rom←disc) :

.nf
.RS
my←prompt% cd ~my←account
my←prompt% mkdir gnuplot
my←prompt% cd←link -r /cd-rom←disc/x11r2/gnuplot gnuplot
.RE
.fi
.SH MAKING AN EXECUTABLE CD←LINK

Because we wish our CD-ROM publications to be usefull on as
many platforms as possible, 
.B cd←link
is distributed in source form.  To make the executables you will
need a
.B C
compiler (which is a standard part of most UNIX systems).  First, copy
.B cd←link.c
from the CD-ROM onto a hard disk.  On most systems this will look
somehthing like this:

.nf
.RS
% cp /cd-rom/ym←utils/"cd←link.c;1" cd←link.c
.RE
.fi

The quotes around
.B cd←link.c;1
above are necessary to prevent the shell from interfering with
the operation.  Note that on some platforms the ";1" will not be needed
because the CD-ROM filesystem driver may automatically strip it off.

After you have a copy of 
.B cd←link.c
on your hard disk, you need to compile it.  Type:

.nf
.RS
% cc -o cd←link cd←link.c
.RE
.fi

This will create an executable file named
.B cd←link.
On some platforms it may be necessary to link in a BSD compatibility
library.  HP-UX machines are in this catagory.  In this case you should
instead type:

.nf
.RS
% cc -o cd←link cd←link.c /usr/lib/libBSD.a
.RE
.fi

Once you have successfully created the executable you may want to
install it in a commonly accessible location like /usr/local/bin.
.SH NOTES

While all filenames on CD-ROM discs from Young Minds are stored using
upper case letters, the CD-ROM filesystem driver for the Sun workstation
automatically translates all upper case filename characters to lower case.
.B cd←link 
automatically detects several types of translations that
are commonly performed by CD-ROM filesystem drivers, so this
should cause no problems.
.LP
The directory
.IB cdrom←directory
need not reside on a CD-ROM disc, as long as it contains a copy of all
files from a directory on a CD-ROM disc (and that directory's
sub-directories, if you wish to use the
.B -r
option).

.LP
While the current version of Young Minds' CD-ROM Publishing Software
generates translation tables entries for block device nodes, character
device nodes, pipes, and sockets (denoted B, C, P, and S), the current
version of 
.B cd←link
ignores these entries as there is not yet a well defined, machine
independent mapping for these entries.
.SH ALSO SEE
.BR YMTRANS.TBL (5),
.SH BUGS

While there is no reason why the program could not be useful in
making directory trees of symbolic links to arbitrary directories, the
required translation file only allows the program to be used on directory
(or directory trees) that contain correct translation files.
.LP
\(dg \s-1UNIX\s0 is a trademark of Bell Laboratories.