From owner-freebsd-questions Wed Aug 7 10:17:22 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id KAA21144 for questions-outgoing; Wed, 7 Aug 1996 10:17:22 -0700 (PDT) Received: from ime.net (ime.net [204.97.248.4]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA21137 for ; Wed, 7 Aug 1996 10:17:19 -0700 (PDT) Received: from kimiko.tcguy.net (buxton-8.ime.net [206.231.148.137]) by ime.net (8.7.4/8.6.12) with SMTP id LAA02410; Wed, 7 Aug 1996 11:54:54 -0400 (EDT) Message-ID: <3208BC55.124F@ime.net> Date: Wed, 07 Aug 1996 11:55:01 -0400 From: Gary Chrysler Reply-To: tcg@ime.net Organization: The Computer Guy X-Mailer: Mozilla 3.0b6 (Win95; I) MIME-Version: 1.0 To: Don Yuniskis CC: fqueries@jraynard.demon.co.uk, questions@freebsd.org Subject: Re: perhaps i am just stupid. References: <199608071139.EAA17578@seagull.rtd.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Don Yuniskis wrote: There *must* be some major confusion between us! > > It seems that Gary Chrysler said: > > [snip -- too much history here! :>] > Agreed! > Argh! I had assumed there was a cksum.exe I'll look into booting > DOS and compiling it... No there isn't .. Especially one that outputs the EXACT same output that FreeBSD's cksum outputs.. They must AGREE 100% ie: The output must be exactly the same else comp will fail! I probably already ported cksum. I'll have to go look! I borrowed the crc code for a PtoP network file transfer package I wrote. :) Also Unix \n versus Dos's \r\n must be accounted for! comp will fail over this! (This could easliy be done by the creator of checksum.sum at FreeBSD just by running a unix2dos script on it! I happen to have two lovly perl scripts that do this both ways! Thanks to Brian Clapper .) > > So, Why waste time doing both.. a Dos based cksum compatiable with > > FreeBSD's cksum's output as well as a kludge'y batch file! > > It would be just as easy to whip up a dos based program that > > read the *.sum files and compared them to the files on the fly! > > I would advocate *against* modifying the code for this. Put that > functionality into a .BAT file wrapper. This allows someone > already knowledgable in cksum(1) to modify the BAT file without > having to learn some bogus *new* MyCksum program. Also cuts down > on the maintenance of yet another piece of software (and, is more > in tune with the UNIX philosophy of building with existing tools). I'll buy that! But, Um, We are talking about the Dos side! The unix side is already doable! For both, The creation of checksum.sum for dos systems, And for testing such files on a Unix system. > It hardly seems worth any "performance increase" to replace DOS's > batch file interpretter with hardcoded system("cksum.exe") Likly wouldn't be much performance difference! Just a whole lot smarter! > > > cksum %1.?? > %1.tmp > > comp %1.sum %1.tmp > > > > I belive this is what you meant. (That is if all the binarys have a > > two digit extension) > > But, it will hose you if foo.xx exists, etc. I would hope that foo.xx exists since that is the file that is to be checked sum'd against the checksum.sum created by FreeBSD.org cksum foo.xx > foo.tmp In plain english: send cksum of foo.xx to file foo.tmp (Overwrite if exist) > > > cksum %1.* > %1.tmp > > Would cause the .tmp and .sum to be cksum'ed. > > > > cksum %1.0* > %1.tmp > > Whats the ^.. for?? > > So the .tmp and .sum would NOT be cksum'ed! :> And how is this to stop that?? foo.0* means any foo.0xx Where xx means anything or nothing. > > > > Briefly, this cksums all files in a given group (bin.*, sbin.*, etc.) This will cksum only bin.0*, sbin.0* not bin.* or sbin.*. AFAIK those *.0* files don't exist, AFAIK they are named: bin.aa bin.ab ... > > > *except* for the ".sum" file and the ".tmp" file of the same name > > > (e.g., bin.sum and bin.tmp -- DOS creates bin.tmp to catch the output > > > of the cksum command. But, if you said 'cksum %1.* > %1.tmp', DOS > > > would pass %1.tmp to cksum, too! :-( Now, you have %1.tmp holding Who said anything about 'cksum %1.*' ?? I didn't. I said 'cksum %1.??' There is a huge difference! Of course this will cause a problem if the files ever go beyond a 2 digit extension.. I don't see that happening. Still have numeric values if zz is reached. (I don't know what they are up to though) > > > the computed checksums for all of the %1.0* files. Presumably, > > > %1.sum (e.g., bin.sum) would already contain the checksums for these > > > files -- because they were computed in the same way from the > > > *originals* at freebsd.org. Then, 'comp' (roughly the equivalent > > > of cmp(1)) just does a compare between the two files. > > > > I don't understand where you get the .0* from.. > > See above (Uh, d'uh....) :> Uh, d'uh What?? I still don't understand where you get the .0* from. %1.0* would result in foo.0xx where xx is anything or nothing! Like I said at the very begining of this message! We must be on two totally different wavelengths. :) -Enjoy Gary ~~~~~~~~~~~~~~~~ Improve America's Knowledge... Share yours The Borg... Where minds meet (207) 929-3848