Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cs.utexas.edu!husc6!bbn!rochester!ritcv!cci632!ccicpg!nick From: nick@ccicpg.UUCP (Nick Crossley) Newsgroups: comp.unix.wizards Subject: cmp efficiency Summary: cmp is NOT wrong Message-ID: <3048@ccicpg.UUCP> Date: 23 Jun 88 01:08:21 GMT References: <16186@brl-adm.ARPA> <56810@sun.uucp> Reply-To: nick@ccicpg.UUCP (Nick Crossley) Organization: CCI CPG, Irvine CA Lines: 15 > While we're on the subject of efficiency, cmp is coded wrong. It should > first stat the two files to be compared. If the character count is different, > so are the files. And files tend to be different more often than the same. First, files given to cmp are quite likely to be the same, in my experience. Second, if the files are not the same size, cmp will tell you if they have the same contents up to the length of the shorter (cmp will say 'EOF on file 1/2'). I find this useful in some contexts, and would not want cmp just to give up if the sizes differed. -- <<< standard disclaimers >>> Nick Crossley, CCI, 9801 Muirlands, Irvine, CA 92718-2521, USA Tel. (714) 458-7282, uucp: ...!uunet!ccicpg!nick