The cd←copy Program


	The cd←copy program, copies files/directories stored on a
CD-ROM created by Makedisc, the CD-ROM formatting software from
Young Minds, Inc., to a specified target directory on hard disk.
What makes this program more useful than a standard copy utility
is that it will recover the original UNIX file/directory names off
the CD-ROM disc and, in essence, restore the original UNIX file
system.  The program uses a 'cdrom←directory' to search for a
translation file (for example, 'YMTRANS.TBL').  If found the program
uses the file to convert the ISO 9660 names back to the original
UNIX names and copies the specified files and directories to a
specified destination.

	Usage for cd←copy is as follows:

cd←copy [-rR] cdrom←directory

	The -r option will recursively descend the subdirectory
rooted at cdrom←directory copying the directory tree at each level.

	The -R option is for use with a Rock Ridge driver and will
copy an image with Rock Ridge extensions.

NOTE:  For those with Rock Ridge drivers, we recommed using this
utility instead of cp because cp may have difficulty with some of
the file types as well as being somewhat slower.

	The following example demonstrates how to recreate the
directory tree for 'gnuplot' in the directory ~my←account/gnuplot
(where the CD-ROM image has been mounted as /cd-rom←disc):

cd ~my←account
	
Move to the ~my←account directory.


	In order to support as many end users of CD-ROM as
possible, (some of which are probably unanticipated) the
cd←copy utility is provided in source form.  So, if binaries
are not present on your platform, you can create them by
compiling the source code with a standard ANSI C compiler
(available on most UNIX platforms).

	First, copy the source to your current directory:

cp /cd-rom/ym←utils/"cd←copy.c;1" cd←copy.c

	The quotes around the cd←copy.c;1 are necessary to prevent
the shell from interferring with the operation.  Next, enter:

cc -o cd←copy cd←copy.c

	This will create an executable called cd←copy.  On some
platforms it may be necessary to link in a BSD compatibility
library.  Check with your system administrator or operating
system documentation to see if this is the case for your machine.
If so, to get cd←copy to compile you should enter the following
command:

cc -o cd←copy cd←copy.c /usr/lib/libBSD.a

	When your UNIX prompt reappears, enter the following commands:

mkdir gnuplot

	Create the gnuplot directory to use in recreating the
directory tree.

cd gnuplot

	Move to the gnuplot directory.

../cd←copy -r /cd-rom←disc/x11r2/gnuplot

or, if you want to direct output to the gnuplot directory from
elsewhere, try:

cd←copy -r /cd-rom←disc/x11r5/gnuplot <PATH>/gnuplot

where <PATH> is the path to the gnuplot directory.


	It will take a little while, but once it's finished,
listing the contents of your gnuplot directory will now show the
files in the gnuplot directory on the CD-ROM, except that the
original UNIX filenames will appear instead of the actual,
translated filenames on the CD-ROM.  If you want to see how they
are different, you save the listings of both your gnuplot
directory and the one on the CD-ROM to files and apply the
'diff' utility.

NOTE:  While all filenames on CD-ROM discs from Young Minds, Inc.
are stored using uppercase letters, some CD-ROM file system
drivers will automatically convert the filename characters to
lowercase.

	Once you have successfully created the executable, you
may wish to store it in some commonly accessible location like
'/usr/local/bin'.
	Also, while the current version of Makedisc generates
translation table entries for block device nodes, character device
nodes, pipes and sockets (denoted as B, C, P, and S), the current
version of cd←copy ignores these entries since there is as yet no
well-defined, machine-independant mapping for these entries.