Add --no-prefetch flag to disable downloading the whole torrent #83
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been playing with making peer-to-peer software repositories for DNF/RPM. This tool is very useful since I can create a torrent of my repository and mount it to make the repo accessible to the package manager.
I noticed in #72 that btfs by design downloads the whole torrent. In my use case, I only want the files that the package manager needs to read to be downloaded from the torrent, and it seems from that issue that other users may have similar use cases.
In this pull request I have added the
--no-prefetch
flag which when used changes the behaviour of btfs in the following ways:setup()
function.This means that once a file is partly read, pieces of that file only will be downloaded in the background, but the priority will still be on the parts of the file the application requested from the filesystem.
Thank you for your time and consideration.