elmindreda / duff

Command-line utility for finding duplicate files
Other
94 stars 12 forks source link

-c -T -R, leaks, malloc checks #8

Open marcin-gryszkalis opened 8 years ago

marcin-gryszkalis commented 8 years ago

several changes included, unfortunately with old indent (happy to see you switching to 4-spaces).

I don't know is use-case for -c is clear (I'm trying to make an example for man-page, I not commited yet though). I have a script similar to join-duplicates.sh (in perl) but using this -c mode - before I had problems with case with two (or more) groups or hardlinks, eg. 5 file entries, all the same content, hardlinked in groups like: inode / name: 100 / a.txt 100 / b.txt 200 / c.txt 200 / d.txt 200 / e.txt and with -p mode duff reported duplicate group of a.txt c.txt

in next run it was not impossible to get from duff -p following list: d.txt a.txt and after merge I had 200 / a.txt 100 / b.txt 100 / c.txt 200 / d.txt 200 / e.txt

and so on... never ending story. Alternatively I could run duff without -p but it causes reporting all the properly hardlinked groups - not fun either. So -c fixes the case :)

I'll try to update the man page during weekend. Feel free to ask about the changes I made - I'd love to see them in duff ;)