A self-referential challenge

Michael Paul Hunter bagpiper at oxy.edu
Mon Mar 27 05:32:52 AEST 1989


In article <990 at philmds.UUCP> leo at philmds.UUCP (Leo de Wit) writes:
>In article <6219 at bsu-cs.UUCP> dhesi at bsu-cs.UUCP (Rahul Dhesi) writes:
>|I recently posted "brik", a general-purpose CRC-32 program, to
>|comp.binaries.ibm.pc (includes portable C source) and was amused to
>|consider the following problem.  The command
>|
>|     brik -G * > crc.lst
>|
>|generates a list of filenames and CRCs in crc.lst, which may be later checked
>|with
>|
>|     brik -C crc.lst
>|
>|This always reports a CRC error for "crc.lst" itself, since the CRC
>|recorded for it was based on its contents before it was closed.  What I
>|would like to do is find a way of having brik generate a CRC list that
>|includes the corect CRC of the file containing that list.  I don't
>|expect to find a simple solution, but it will be fun seeing people
>|try.

Quick, obvious fix/hack....  Put it on a different drive and brik it
separately to the first drive.... :)

					  m



More information about the Comp.lang.c mailing list