akaihola / hardlinkpy

hardlink.py is a tool to hardlink together identical files in order to save space. Forked from the original version by John L. Villalovos.
http://code.google.com/p/hardlinkpy/
GNU General Public License v2.0
20 stars 8 forks source link

Bytes saved doesn't take into account if link destination file was already linked #20

Open chadnetzer opened 6 years ago

chadnetzer commented 6 years ago

The bytes saved calculation doesn't take into account whether the destination file is already hardlinked, which makes the result overly optimistic. If a destination file is already hardlinked, it shouldn't count towards the bytes saved in did_hardlink().

If/when the stat_info data saved to file_hashes is kept up to date after the link() operation, we could use it to properly calculate the amount of bytes saved (basically when a link destination file has a link count of 1).