in reply to Re: Identical Files to Symbolic Links
in thread Identical Files to Symbolic Links
sum has to read the entire file anyway, so there’s no gain from checksumming them to decide whether you want to compare them.
The right method to do this would be to put all the files in one set to start out with, read them byte-for-byte, and whenever files disagree, split the set into one set for each byte value encountered. Whenever a set consists of just one file, you can drop it. When you get to the end of any of the files and still have sets with more than one file in them, each of the sets is a group of identical files.
Of course, this is unworkable when you have more files than available handles. But in that case, all solutions I can think of (I wrote up and deleted three so far) are ugly as sin. Checksumming will usually get you out of the bind, but in edge cases with a huge number of identical files, that approach is really painful. Hmm.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Identical Files to Symbolic Links
by jdporter (Paladin) on Nov 10, 2005 at 03:45 UTC | |
by Aristotle (Chancellor) on Nov 10, 2005 at 04:01 UTC | |
by jdporter (Paladin) on Nov 10, 2005 at 15:38 UTC | |
|
Re^3: Identical Files to Symbolic Links
by blazar (Canon) on Nov 10, 2005 at 13:36 UTC |