![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: Remove Duplicate Filesby DrHyde (Prior) |
on Oct 29, 2004 at 08:27 UTC ( [id://403630]=note: print w/replies, xml ) | Need Help?? |
Agreed. You can make it a lot more efficient by stat()ing all the files and only bothering to compare the contents of those which are the same size. Another small improvement can come from noting that those with the same device number and inode number are guaranteed to be the same so no need to compare their contents, although this may not be portable to non-Unixy platforms.
You should also be careful about how you compare symlinks and device files.
In Section
Code Catacombs
|
|