JohnDoee / autotorrent

Matches torrents with files and gets them seeded
MIT License
269 stars 34 forks source link

CoW support via reflinks if available #44

Closed znedw closed 4 years ago

znedw commented 4 years ago

Basic Copy-on-write support via reflinks, works on Linux & Mac OS.

Actual reflinking code pilfered from here: https://github.com/iterative/dvc/blob/f4bec650eddc8874b3f7ab2f8b34bc5dfe60fd49/dvc/system.py#L105

No tests added because they will break if not run on XFS, btrfs or APFS filesystems.

Let me know what you think.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-2.4%) to 76.501% when pulling e21cc7eadae0a290239c7889ed9ec873f3e95fbd on znedw:develop into e8ffdcf04ad592d029dc7e20d2bee7c60477bb02 on JohnDoee:develop.

JohnDoee commented 4 years ago

Thanks for making this, it's a feature I've been eyeing myself.

Since you took it from a different project, I'm happy to see it's a nice license. My understanding is that Apache 2 requires attribution, so if you can add a reference to the original project somewhere next to the code you copied it should be all good.

Something along the lines of

This code is modified from DVC (https://github.com/iterative/dvc/blob/f4bec650eddc8874b3f7ab2f8b34bc5dfe60fd49/dvc/system.py#L105)

znedw commented 4 years ago

Thank-you, just added the attribution inline!