![]() |
|
Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Remove Duplicate Filesby gaal (Parson) |
on Oct 29, 2004 at 07:07 UTC ( [id://403616]=note: print w/replies, xml ) | Need Help?? |
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
|
|