chksum in tar header block

Per H. Nielsen phn at dde.uucp
Wed Feb 3 03:16:16 AEST 1988


In article <243 at mancol.UUCP>, samperi at mancol.UUCP (Dominick Samperi) writes:
 > Can somebody explain how the chksum in a tar header block is computed? My
 > docs say that it is equal to the sum of the bytes in the 512-byte header,
 > assuming that all bytes of the checksum itself are blanks.
 > On the other hand, when I dump a tar archive from
 > either system I can't seem to compute a checksum by hand that
 > agrees with the figure displayed.


It is correct that the checksum is the sum of the 512 header
bytes after filling the checksum field itself with spaces.

The checksum is then written as a string giving the *octal*
representation of the checksum. Maybe you forgot to convert
your hand computed sum to octal ??.

-- 
+---------------------------------------------------------------------------+
|   Per H. Nielsen @ Dansk Data Elektronik A/S,                             |
|   E-mail:  ..!uunet!mcvax!diku!dde!phn  or  phn at dde.uucp                  |
+---------------------------------------------------------------------------+



More information about the Comp.unix.wizards mailing list