home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_progs
/
miscutil
/
crc.lzh
/
CRC
/
CRC.MAN
< prev
next >
Wrap
Text File
|
1991-08-16
|
5KB
|
199 lines
CRC(1) AmigaDOS 1.2 CRC(1)
NAME
crc - generate or verify a 16-bit crc for a file
SYNOPSIS
crc [-g|-G|-v|-V] [filename ...]
REVISION
1.000, compiled with Manx 3.4b C compiler.
DESCRIPTION
crc provides a means of verifying two files are the same
with a relatively high degree of certainty. It does this
without the neccessity of having a duplicate of the file
immediately accessible. A 16-bit crc (cyclic redundancy
check) is calculated for a file's contents. This crc can
either be saved, or automatically compared to a reference
crc previously calculated. Decisions can then be made
according to the code returned.
When no options are specified, crc, by default,
interprets all parameters on the command line as file
names. For each file name, the file is opened and a CRC
is calculated. Then the file name and CRC are written to
the standard output. File names may include wild card
characters. If an error occurs while processing a file,
an appropriate message is written to the standard output
and processing continues with the next file name.
OPTIONS
If there is only one command line parameter and it
starts with a '-' (minus) character, it is interpreted
as an option. If there is more than one command line
parameter, or one command line parameter and it does
not start with '-', all command line parameter(s) are
interpreted as file names. Only one option may be
specified from the command line.
-g Generate option. This causes the standard input to
be parsed for file names until an end of file
character is detected. File names may include wild
card characters(explained later).
-G Same as -g option.
-v Verify option. This causes the standard input to be
parsed for file names until an end of file
character is detected. Wild card characters are
interpreted literally with no special meaning. For
each file name parsed, the CRC is computed for the
file and then compared to the CRC string on the end
of the line. Any mismatch will cause a return code
of 10. If an error occurs while processing the
file, an appropriate error message is written to
the standard output and the return code is set to
10. Even though an error is detected, processing is
(12/29/87) Copyright 1987, by Don Kindred Page 1
CRC(1) AmigaDOS 1.2 CRC(1)
continued until the end of file character from the
standard input. The file-names are NOT echoed back
to the standard output, unless an error occurrs.
-V Same as -v, except nothing is sent to the standard
output. Normally some sort of heading message is
sent to the standard output.
Note that any time an option is specified, the
standard input will be read until an EOF character
(control '\', from the Amiga keyboard) is encountered.
WILDCARD EXPANSION
File names may contain wild card characters. '?'
matches any single character. '*' matches any number
of characters. The verify (-v or -V) option won't make
any substitions. Instead, it interprets '*' and '?'
literally.
ODD CHARACTERS IN FILE NAMES
If a file name contains a space, the name must be
enclosed inside double quotes (").
COMMENT LINES
For the -g, -G, -v and -V options, all blank lines and
comment lines are ignored. A comment line starts with
the # character and ends with the newline character.
ERRORS
crc sets a return code of 10 if any type of error was
encountered. A return code of 0 means everything was OK.
EXAMPLES
To generate crc's for files "file1" and "FILE 2" you
could enter:
crc file1 "FILE 2"
To generate the crc's again and save them in in a file
"tmp", enter this:
crc >tmp file1 "FILE 2"
To verify those two files you might enter:
crc <tmp -v
To verify those two files again and make a decision based
on the error code:
FAILAT 11
crc <tmp -v
if ERROR
echo "There was an error" ;do this if the crc's don't match
else
echo "Files are OK" ;do this if the crc's are OK
endif
To generate new crc's for the previous files:
crc <tmp -g
(12/29/87) Copyright 1987, by Don Kindred Page 2
CRC(1) AmigaDOS 1.2 CRC(1)
To generate crc's for all files in the current directory
with names containing the letter "A":
crc *A*
AUTHOR
Don Kindred
BUGS
No major bugs have been reported. If you find any bugs or
would like to hire a good C programmer, fell free to drop
me a line:
Don Kindred
5430 S. Keystone Ave.
Indpls., IN 46227
(12/29/87) Copyright 1987, by Don Kindred Page 3