The Graham Utilities for OS/2 - Version 2


[Warpspeed]

[Table of Contents] [Index] [Previous] [Next]


SUM - Check Sum Files

Summary

Sum produces a check sum of a file using a variety of methods.

Icon

Command Line Format

Usage: SUM {Switches} <File Spec> Drive Spec(s)

Switches

-a
All disks.
-h
Hard disks only.
-s
Include subdirectories in the search.

Note : If no file specification is entered, all files are listed. If drive specifications are entered then those drives are searched. If no drive specifications are entered then the current drive is searched.

Description

Sum produces a check sum of all files matching the given file specification using a variety of methods. It will display a check sum using the following methods:

SUM8
All of the bytes are added up using an 8 bit (or byte) number. This effectively lists the sum of bytes modulo 255 (FFh). The value is displayed in hexadecimal.
SUM16
All of the bytes are added up using an 16 bit (or word) number. This effectively lists the sum of bytes modulo 65,525 (FFFFh). The value is displayed in hexadecimal.
SUM32
All of the bytes are added up using an 32 bit (or double word) number. This effectively lists the sum of bytes modulo 4,294,967,295 (FFFFFFFFh). The value is displayed in hexadecimal.
CRC16
This method uses a special 16 bit polynomial to calculate the displayed result. The value is displayed in hexadecimal.
CRC32
This method uses a special 32 bit polynomial to calculate the displayed result. The value is displayed in hexadecimal.
BSD
This method is compatible with the SUM command using BSD UNIX. The value is displayed in decimal.
SysV
This method is compatible with the SUM command using System V UNIX. It is the same as SUM32, except that the value is displayed in decimal.

As SUM is generally used by UNIX systems, SUM is normally used with MIDecode, UUDecode or XXDecode to verify the integrity of the file. Quite often, the original encoding program will place the SUM of the original file in the UU file.

-a All disks

SUM will scan all logical disk drives defined by the system, starting at drive A:. The drives are scanned in order, starting at A:, then B: and so on.

-h Hard disks only

SUM will scan all logical disk drives defined by the system, starting at drive C:. The drives are scanned in order, starting at C:, then D: and so on.

-s Subdirectories

SUM will include subdirectories as part of its search of the specified disk drives. If a subdirectory name is included as part of the file specification, then the search will include that subdirectory and all subdirectories below it. If no subdirectory is given as part of the file specification, then the current directory and all below it are included in the search.

Examples

SUM *.c
SUM will look for all .C files and list the 8, 16 and 32 bit sum, 16 and 32 bit CRC, BSD and System V values for each of the files.
SUM C:\CONFIG.SYS
SUM the file C:\CONFIG.SYS only.