|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Remove Duplicate Filesby gaal (Parson) |
| on Oct 29, 2004 at 03:07 UTC ( [id://403616]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
MD5 collisions are rare, but they can happen. If you want to be really safe, your storage should not just keep track of seen hashes; it should make them the key of a list of files that have those hashes. Then when you detect a seen hash, you should byte-compare the new file with all the existing files on that list.
This, of course, is slower, adds complexity, and will rarely be useful; but personally, I want code that deletes files automatically to be correct!
In Section
Code Catacombs
|
|
||||||||||||||||||||||||||||||||||||