Re: Best way of identifying duplicate files in Cocoa
Re: Best way of identifying duplicate files in Cocoa
- Subject: Re: Best way of identifying duplicate files in Cocoa
- From: Bill Bumgarner <email@hidden>
- Date: Wed, 21 Nov 2007 01:55:56 -0800
On Nov 21, 2007, at 1:33 AM, Jean-Daniel Dupas wrote:
To get a MD5 you have to read the file, AND compute the digest. To
compare to file, you just have to read the file. What is the benefit
of the MD5 in this case?
I can MD5 the first N bytes and build up a shallow tree of all files
that are (a) of the same size and (b) are identical for the first 1024
bytes (as hashed by a checksum of said bytes).
From there, yes, calculating an md5 of full file contents is a
complete waste of time when comparing whole files. Given the relative
infrequency of files that are identical within the first 1K, the
silliness of those particular lines of code were never identified as a
performance bottleneck. ;)
b.bum
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden