home *** CD-ROM | disk | FTP | other *** search
- * copy.c - Ben Williams, Barry Chalmers
- *
- * February 9th... and onward, 1991
- *
- * Written so we could see what was going on during ram copies
- * over the "DNET" network. We found it rather unerving to be
- * sitting around waiting for ten minutes while, at 9600 baud,
- * dnet mumbled to the other system about how long this file
- * was, and how the perpetrators really should have used
- * a 'real' net or at least "sneakernet". :^) This is not a
- * complete implementation of the AmigaDOS "copy" command, but
- * it does have most of the major functionality - more than
- * enough for network use.
- *
- * Not as fast as the system copy due to bar handling and such;
- * AmigaDOS is a better choice is speed is the primary issue.
- *
- * No attempt was made to make the command efficient in terms
- * of command size (or anything else, for that matter). We
- * just needed the bar capability, and this provides it. If this
- * command is of use to you, great. If not, throw it out and
- * forget about it.
- *
- * The following "normal" AmigaDOS copy parameters/ops are not
- * supported in this version of 'coppy':
- *
- * the keyword 'FROM'
- * the keyword 'TO'
- * the keyword 'ALL'
- * the keyword 'QUIET'
- * the keyword 'CLONE'
- * the keyword 'BUF'
- * the keyword 'DATE'
- * the keyword 'NOPRO'
- * the keyword 'COM'
- *
- * As a result, the output files will:
- * - have the current date/time
- * - not have the original file comment, if any
- * - have the original files protection bits
- *
- * And, you cannot copy multiple levels of a directory tree,
- * or a directory (in other words, the coppy command won't
- * create directories).
- *
- * The lack of the 'FROM' and 'TO' arguments has no effect on
- * the ability of the command to do the work for which it was
- * intended.
- *
- * The bar graph that shows the remaining amount of file to copy
- * will not appear if the file is less than about 1k. Copies of
- * that size are so fast that it's kind of pointless to put up the
- * bar (yes, even over DNET!). In multiple file copies, short
- * files will be accounted for in the second bar graph, which
- * indicates number of files to go in the copy.
- *
- * Filenames may contain the following wildcards:
- *
- * wildcard meaning
- * ------------- ---------------------------------------------
- * * "any number of any characters"
- * ? "one of any character"
- * # "any number of the FOLLOWING character"
- *
- * NOTE: Underneath it all, this copy command uses the Lattice
- * (now SAS) C library stcpma() function. This function
- * is a little bit stupid... it won't allow the use of
- * more than one '*' wildcard in a pattern; and we are
- * processing '#?' sequences into '*' characters for the
- * stpcpma() function, so you can't use multiple sequences
- * of '#?', either. Luckily, this would be an exceptional
- * use of a copy operation. At least, for us. :^)
- *
- * The following table indicates the possible combinations of legal source
- * and destination specifiers available here. The term 'wildname' is a
- * filename that may contain wildcards. The term 'filename' must not contain
- * wildcards.
- *
- * source dest
- * -------------- -------------
- * [path]wildname [path]filename
- * [path]wildname [path]dirname
- * [path]wildname devname
- * [path]wildname "" (this is shorthand for "here", or 'cd')
- * [path]dirname [path]dirname
- * [path]dirname devname
- * devname [path]dirname
- * devname devname
- * devname [path]filename (only legal when 1 file in devname)
- * [path]dirname [path]filename (only legal when 1 file in [path]dirname)
- *
- * coppy will return (0) if successful, (1) if user aborted op and target
- * file was deleted, or (>1) if there was an internal problem.
-