home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d133 / crc.lha / Crc / crc.man < prev    next >
Text File  |  1988-03-13  |  5KB  |  199 lines

  1.  
  2.  
  3. CRC(1)                  AmigaDOS 1.2                  CRC(1)
  4.  
  5. NAME 
  6.    crc - generate or verify a 16-bit crc for a file 
  7.  
  8.  
  9. SYNOPSIS 
  10.    crc [-g|-G|-v|-V] [filename ...] 
  11.  
  12.  
  13. REVISION 
  14.    1.000, compiled with Manx 3.4b C compiler. 
  15.  
  16.  
  17. DESCRIPTION 
  18.    crc provides a means of verifying two files are the same
  19.    with a relatively high degree of certainty. It does this
  20.    without the neccessity of having a duplicate of the file
  21.    immediately accessible. A 16-bit crc (cyclic redundancy
  22.    check) is calculated for a file's contents. This crc can
  23.    either be saved, or automatically compared to a reference
  24.    crc previously calculated. Decisions can then be made
  25.    according to the code returned. 
  26.  
  27.    When no options are specified, crc, by default,
  28.    interprets all parameters on the command line as file
  29.    names. For each file name, the file is opened and a CRC
  30.    is calculated. Then the file name and CRC are written to
  31.    the standard output. File names may include wild card
  32.    characters. If an error occurs while processing a file,
  33.    an appropriate message is written to the standard output
  34.    and processing continues with the next file name. 
  35.  
  36.    OPTIONS 
  37.       If there is only one command line parameter and it
  38.       starts with a '-' (minus) character, it is interpreted
  39.       as an option. If there is more than one command line
  40.       parameter, or one command line parameter and it does
  41.       not start with '-', all command line parameter(s) are
  42.       interpreted as file names. Only one option may be
  43.       specified from the command line. 
  44.  
  45.       -g Generate option. This causes the standard input to
  46.          be parsed for file names until an end of file
  47.          character is detected. File names may include wild
  48.          card characters(explained later). 
  49.  
  50.       -G Same as -g option. 
  51.  
  52.       -v Verify option. This causes the standard input to be
  53.          parsed for file names until an end of file
  54.          character is detected. Wild card characters are
  55.          interpreted literally with no special meaning. For
  56.          each file name parsed, the CRC is computed for the
  57.          file and then compared to the CRC string on the end
  58.          of the line. Any mismatch will cause a return code
  59.          of 10. If an error occurs while processing the
  60.          file, an appropriate error message is written to
  61.          the standard output and the return code is set to
  62.          10. Even though an error is detected, processing is
  63.  
  64. (12/29/87)     Copyright 1987, by Don Kindred         Page 1
  65.  
  66.  
  67.  
  68.  
  69. CRC(1)                  AmigaDOS 1.2                  CRC(1)
  70.  
  71.          continued until the end of file character from the
  72.          standard input. The file-names are NOT echoed back
  73.          to the standard output, unless an error occurrs. 
  74.  
  75.       -V Same as -v, except nothing is sent to the standard
  76.          output. Normally some sort of heading message is
  77.          sent to the standard output. 
  78.  
  79.       Note that any time an option is specified, the
  80.       standard input will be read until an EOF character
  81.       (control '\', from the Amiga keyboard) is encountered. 
  82.  
  83.    WILDCARD EXPANSION 
  84.       File names may contain wild card characters. '?'
  85.       matches any single character. '*' matches any number
  86.       of characters. The verify (-v or -V) option won't make
  87.       any substitions. Instead, it interprets '*' and '?'
  88.       literally. 
  89.  
  90.    ODD CHARACTERS IN FILE NAMES 
  91.       If a file name contains a space, the name must be
  92.       enclosed inside double quotes ("). 
  93.  
  94.    COMMENT LINES 
  95.       For the -g, -G, -v and -V options, all blank lines and
  96.       comment lines are ignored. A comment line starts with
  97.       the # character and ends with the newline character. 
  98.  
  99.  
  100. ERRORS 
  101.    crc sets a return code of 10 if any type of error was
  102.    encountered. A return code of 0 means everything was OK. 
  103.  
  104.  
  105. EXAMPLES 
  106.    To generate crc's for files "file1" and "FILE 2" you
  107.    could enter: 
  108.       crc file1 "FILE 2" 
  109.  
  110.    To generate the crc's again and save them in in a file
  111.    "tmp", enter this: 
  112.       crc >tmp file1 "FILE 2" 
  113.  
  114.    To verify those two files you might enter: 
  115.       crc <tmp -v 
  116.  
  117.    To verify those two files again and make a decision based
  118.    on the error code: 
  119.       FAILAT 11 
  120.       crc <tmp -v 
  121.       if ERROR 
  122.          echo "There was an error" ;do this if the crc's don't match
  123.       else 
  124.          echo "Files are OK" ;do this if the crc's are OK 
  125.       endif 
  126.  
  127.    To generate new crc's for the previous files: 
  128.       crc <tmp -g 
  129.  
  130. (12/29/87)     Copyright 1987, by Don Kindred         Page 2
  131.  
  132.  
  133.  
  134.  
  135. CRC(1)                  AmigaDOS 1.2                  CRC(1)
  136.  
  137.  
  138.    To generate crc's for all files in the current directory
  139.    with names containing the letter "A": 
  140.       crc *A* 
  141.  
  142.  
  143. AUTHOR 
  144.    Don Kindred 
  145.  
  146.  
  147. BUGS 
  148.    No major bugs have been reported. If you find any bugs or
  149.    would like to hire a good C programmer, fell free to drop
  150.    me a line: 
  151.       Don Kindred 
  152.       5430 S. Keystone Ave. 
  153.       Indpls., IN 46227 
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. (12/29/87)     Copyright 1987, by Don Kindred         Page 3
  197.  
  198.  
  199.