Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downloader: Protect against partially downloaded files. #954

Merged
merged 4 commits into from
Sep 22, 2023

Conversation

modmuss50
Copy link
Member

@modmuss50 modmuss50 commented Sep 21, 2023

Seen one or two users on Discord reporting loom only downloading parts of the file, I think this is quite rare. This change should protect against failed or cancled downloads by ensuring that the output file only exists in its final state.

  1. Download the file initially to a <filename>.part file
  2. Once the file has been fully written, create a hard link to the destination file.
  3. And then remove the part file, this ensures that the output file only exists in fully populated state.

@modmuss50 modmuss50 added the bug label Sep 21, 2023
@modmuss50 modmuss50 added this to the 1.4 milestone Sep 21, 2023
@modmuss50 modmuss50 merged commit bd09af1 into FabricMC:exp/1.4 Sep 22, 2023
74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant