• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best way of identifying duplicate files in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Best way of identifying duplicate files in Cocoa
      • From: Frank Reiff <email@hidden>
References: 
 >Best way of identifying duplicate files in Cocoa (From: Frank Reiff <email@hidden>)
 >Re: Best way of identifying duplicate files in Cocoa (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Best way of identifying duplicate files in Cocoa (From: Frank Reiff <email@hidden>)
 >Re: Best way of identifying duplicate files in Cocoa (From: Michael Watson <email@hidden>)
 >Re: Best way of identifying duplicate files in Cocoa (From: Bill Bumgarner <email@hidden>)
 >Re: Best way of identifying duplicate files in Cocoa (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Best way of identifying duplicate files in Cocoa
  • Next by Date: Re: Source list with counter next to item title
  • Previous by thread: Re: Best way of identifying duplicate files in Cocoa
  • Next by thread: Re: Best way of identifying duplicate files in Cocoa
  • Index(es):
    • Date
    • Thread