Copyright (C) 1993 Frank Linssen
Released to the public domain for free use by all.
Product is supplied as is and author disclaims all warranties,
explicit or implied, about the functionality of the source code
or object modules supplied, and shall not be held responsible
for any damages caused by use of the product.

If you have any questions, please contact me by email at:

linssenf@prl.philips.nl  (in real live Frank Linssen)

I would like to thank:

D.A. Gwyn of BRL (gwyn@brl.arpa)
Henry Spencer University of Toronto (henry@utzoo.uucp)
For their public domain versions of getopt(),regcomp() and regexec()

All these routines were found on the Walnut Creek CDROM

- Source Code CDROM edition March 1992


                        +++++++++++++++


CDR is a utility written in Turbo C 2.0 to find, copy and unpack
files from the SIMTEL20 CDROM to a target directory.

It doesn't execute any programs that are unpacked or copied to the
target directory.
I release this source to the public domain so it can be copied, modified 
etc as long as:

- The origin of this software is not misrepresented, either
  by explicit claim or by omission.

- Altered versions are plainly marked as such, and must not
  be misrepresented as being the original software.

If you have altered anything that could be useful for me please drop me an
email with part of the source code you have changed and a description.
Also you could sent me email if you have a suggestions to enhance my product
or report bugs !!

                        +++++++++++++++


The cdr utility tries to find the CDROM on your system using a call 
to MSCDEX. If no MSCDEX is present or you have more than one cdrom on your system
you have to set an environment variable CDROM.

The default target directory is the current directory.
If environment variable TMPDIR is set this is used as the default
target directory.

If INDEX is not set : default index file     (CDROM):\index.txt
If UNZIP is not set : default unzip command  (CDROM):\pkunzip -d
If UNARC is not set : default unarc command  (CDROM):\pkxarc

The environment variable POST can be use to execute a command after
copying or unpacking data to the target directory.


The following options are recognised by cdr:

-i index.txt             -> index file
-s regular expression    -> search for this regular expression
-n -s regular expression -> don't match this regular expression
-t target dir            -> directory to copy data to 
-e file name to extract  -> filenames to extract
-c                       -> copy data matched to target dir
-u                       -> unpack data to target dir
-d                       -> delete all files and sub directories in target dir
-r                       -> force wipe of whole disk or current directory
-o                       -> take all search options as an or function
-b                       -> use this to create batch files
-f                       -> use the file name only in search
-h                       -> help
-?                       -> help

With option -u only files that are zip or arc files are unpacked. All other
file types are copied to the target directory.
If the target directory doesn't exist it will be created including all sub-
components of the path.

For search regular expressions are used. Look for the description of regular
expression in the file regexp.hlp. This info came from one of the help files
from the regexp program written by Henry Spencer.

Examples:

- Find every file that matches dobbs.
        cdr -s dobbs

- Find every file that matches dobbs and 1992 and unpack these files
        cdr -s dobbs -s 1992 -u

- Find every file that matches dobbs or microsoft
        cdr -s dobbs -s microsoft -o

- Copy all dr. dobbs journals from 1992 to floppy drive b:
        cdr -s dobbs -s 1992 -s journal -c -t b:

- Find all lines that match vga followed by copy on the same line
        cdr -s vga.*copy

- Find svalias and unpack only the doc file
        cdr -s svalias -u -e *.doc

- Unpack all files that match vga followed by copy on the same line
  but not hardcopy in the same line.
        cdr -s vga.*copy -n -s hardcopy -u

- Find all files with extension doc and txt and copy them to e:\newdir
        set TMPDIR=e:\newdir\newdoc
        cdr -f -s doc$ -s txt$ -o -c

  Directory e:\newdir\newdoc will be created by cdr if it doesn't exsist.

- Find all files belonging to telix 3.15, wipe b: drive and copy these
  files to the b: drive. This regular expression matches tlx315_1.zip,
  tlx315_2.zip and tlx315_3.zip.

        cdr -s tlx315\_.\.zip -c -d -r -t b:

- Find all doc and txt files and copy them to e:\newdir
        set TMPDIR=e:\newdir
        cdr -s -f doc$ -s doc$ -o -c

- Copy entire subdirectories ada and zoo to e:\adaandzoo
        cdr -f -s \\ada\\ -s \\zoo\\ -o -t e:\adaandzoo

- Find all files that start with a number follow by a letter from a to c
        cdr -s ^[0-9][a-c]

If a friend of your has no cdrom you can help him by giving a copy
of the index.txt file and the cdr program to create batch files, so
that you can copy data from cdrom using the generate batch files.

set TMPDIR=a:                    Default floppy drive you want to use on your friends
                                 machine
set CDROM=q:                     Your friends cdrom drive lettter

set INDEX=c:\simtel20\index.txt  A copy of the index.txt file

cdr -s ^[0-9][a-c] -c -b >friend.bat

Please excuse me for my "Fred Flintstone" english !!



