Skip to content

fix: Use CopyN to handle growing file size#43

Merged
mholt merged 1 commit intomholt:mainfrom
evanMaia:fix-write-too-long
Jun 23, 2025
Merged

fix: Use CopyN to handle growing file size#43
mholt merged 1 commit intomholt:mainfrom
evanMaia:fix-write-too-long

Conversation

@evanMaia
Copy link
Contributor

Was hitting an issue archiving a tar with a file that was growing. The comment in the code indicates that CopyN should have been used with the file info size. Not sure if there is some history here I am missing.

Added test case that reproduced the issue prior to making the fix.

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thanks for the test case!

That's very interesting, I seem to remember this. It was patched 2 years ago in the previous repo: mholt/archiver@09bbccc

That's from the very last git blame on that repo, whereas the very first on this one shows "Initial commit" without the CopyN. So I'm not sure where it got reverted!! Weird!

Ohhhh I wonder if a linter complained at some point... 😬

If that linter pops up again we should disable it and report it as a faulty linter. Because this is definitely correct.

@mholt mholt merged commit 5fd3600 into mholt:main Jun 23, 2025
3 checks passed
@evanMaia evanMaia deleted the fix-write-too-long branch June 23, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants