pkolaczk / fclones

Efficient Duplicate File Finder
MIT License
1.91k stars 71 forks source link

Make group output deterministic with existing hardlinks #73

Closed th1000s closed 2 years ago

th1000s commented 2 years ago

The non-determinism can be observed as follows:

mkdir d; echo foo > d/1; cp d/1 d/2; ln d/1 d/3 and then fclones group d:

Which of the two hardlinked files is chosen is random because the ordering inside the BTreeMap changes (on purpose).

Sorting the file group fixes that.