CRCZ Version 1.0 Gene Pizzetta May 19, 1990 CRCZ calculates the cyclic-redundancy checksum (CRC) for a group of files, displaying the checksums on the screen, typing them to the printer, and/or writing them to a file. In validation mode, CRCZ reads a checksum file and matches the listed CRC values to files on the disk. CRCZ is for ZCPR3 only. USAGE: CRCZ {dir:}{afn.aft} {{/}options} If a drive/user or named directory is given, all operations are carried out in that directory. Otherwise, the current (default) directory is used. If an ambiguous filename is given, checksums will be calculated for matching files. DateStamper !!!TIME&.DAT files are always ignored, as are temporary files with a filetype of $$$. If no filename is given, CRCZ switches to validation mode. It will look for a checksum file and try to match the listed filenames and CRC values with files on the same drive. DateStamper !!!TIME&.DAT files will never be found. OPTIONS: Options must be preceded by a slash ("/") if no directory or filename is given. F Send output to the file CRCKFILE.CRC on the target drive. This option is ignored in validation mode. L Echo output to the printer (CP/M LST device). P Toggle screen paging. The number of lines on the CRT screen is obtained from the environment descriptor. Whether CRCZ defaults to paging is determined by a configuration byte (see Configuration, below). Paging is always turned off during printer or disk file output, and when quiet mode is in effect. Q Toggle quiet mode, which suppresses screen output, except for error messages. The default quiet mode state is determined by a configuration byte (see Configuration, below). The configuration byte is ignored if the ZCPR3 Quiet flag is set. This option toggles either condition. It has no effect on printer or file output. S Toggle inclusion of system files. Whether system files are ignored by default is determined by a configuration byte (see Configuration, below). This option toggles to the non-default state. It has no effect on the checksum file search in validation mode, when system files are always found. A brief usage message is displayed by using the "//" option. The usage message always reflects the current effect of the toggle options. In invalid option generates an error. If screen paging is not in effect, ^S can be used to pause the display. A ^C will abort the program at any time; an incomplete output file (F option) will be erased. The cyclic-redundancy checksum used by CRCZ is based on the CCITT standard polynomial: x^16 + x^15 + x^13 + x^7 + x^4 + x^2 + x + 1 It is compatible with most such CP/M programs. CRC VALIDATION: In validation mode, CRCZ searches for the files CRCKFILE.???, CRCKLIST.???, CRC.???, and -CATALOG.???, in that order, reading the first such file it finds. It then compares the checksum values of the listed files to matching files on the same disk, if they exist. In searching for a checksum file, the filetype is not significant (except that COM files are ignored), so the filetype may be most anything (the disk number, for instance). Each filename in the checksum file is listed to the screen, followed by "* Match *" if the CRC values match. If they do not match, the old and new CRC values are given. Files not found are so labeled. Upon completion, CRCZ reports the number of matching and non-matching checksums, the number of files not found, and the number of lines failing the parse test. Non-parsing lines at the beginning of the checksum file, such as occur in ZCRCK's CRC.CRC files and in SIG/M's -CATALOG files, are not reported. For validation, the line format of the checksum file is important. The lines produced by CRCZ (CRCKFILE.CRC) consist of a filename, a tab, "CRC = ", and the CRC value in hexadecimal: TEST .DOC CRC = 62 25 CRCZ skips the rest of the line after the CRC value, so a text editor can be used to add a brief file description, if one so desires. Each type of checksum file has its own line format. CRCKLIST lines, created by CRC 6.4, consist of "--> FILE: ", a filename, two tabs, "CRC = ", and the CRC value: --> FILE: TEST .DOC CRC = 62 25 CRC.CRC lines, created by ZCRCK, consist of the drive/user, a colon, a filename, five spaces, and the CRC value (the rest of the line is ignored): N0:TEST .DOC 6225 31D2 1 2 SIG/M's -CATALOG file lines consist of a disk number, a period, a file number,a tab,a filename, several spaces, the filesize, "K", three spaces, and the CRC value (a following comment is ignored): 123.01 TEST .DOC 1K 62 25 ERRORS: All errors are also reported in quiet mode, except individual files not found in validation mode. However, the ZCPR3 program error flag is set to 10 in such cases. In addition, if any file's checksum does not match, the high bit of the error flag is set (that is, 128 is added to it). The program error flag is otherwise set to zero. Any other suggestions about setting the error flag are welcome. CONFIGURATION: Three configuration bytes are available in the first sector of CRCZ.COM. Each is marked by a label in ASCII, immediately followed by the corresponding byte. At the label "PAGING>", a zero disables screen paging. A non- zero value causes CRCZ to pause the display each time the screen fills. As distributed, paging is enabled (non-zero). At the label "QUIET>", a zero defaults to verbose mode. A non- zero value causes CRCZ to default to quiet mode, displaying only error messages. As distributed, verbose mode is enabled (zero). At the label "SYSFILES", a zero excludes system files by default. A non-zero value causes system files to be included. As distributed, system files are excluded (zero). HISTORY: I've never found a file checksum calculator I was happy with. CRC 6.4 (October 30, 1984) came closest, but it was not a ZCPR3 utility and lacks some important features (particularly, recognition of DU specifications). Still, it came closer to what I wanted than anything else because it could automatically read back its CRCKLIST.CRC file and then compare it with the checksums of the files on the disk. Unfortunately, I couldn't find the source code, so CRCZ is based on a disassembly of CRC 6.4. I would very much like to hear any suggestions for improvements and, expecially, I want to know about any bugs (please don't assume that I know about them). Gene Pizzetta 481 Revere St., Floor 2 Revere, Massachusetts 02151 Voice: (617) 284-0891 Newton Centre Z-Node: (617) 965-7259 GEnie: E.PIZZETTA Version 1.0 -- May 14, 1990 -- Gene Pizzetta Recognizes DU and DIR specifications. Displays usage message with "//" option. Uses correct name from external FCB in usage message. Simplified output file format for CRCKFILE.CRC. When looking for a checksum file, finds system files, but ignores files with filetype COM. Looks for CRCKFILE.CRC (created by this program), CRCKLIST.CRC (CRC 6.4), CRC.CRC (ZCRCK), and -CATALOG files output by SIG/M. When calculating checksums, always ignores DateStamper !!!TIME&.DAT files and temporary ($$$) files, and ignores system files by default. Use 'S' option to include system files. Use 'L' option for printer output. Use 'P' option to toggle paged display. Use 'Q' option to toggle suppression of all screen output except error messages. Uses number of screen lines from Environment Descriptor. In validation mode, sets program error flag to 10 if no checksum file or a file listed in a checksum file is not found. A checksum mismatch sets high bit (adds 128) of the error flag.