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

Builder::append_* methods corrupt archive when file size changes #352

Open
tp971 opened this issue Dec 27, 2023 · 0 comments
Open

Builder::append_* methods corrupt archive when file size changes #352

tp971 opened this issue Dec 27, 2023 · 0 comments

Comments

@tp971
Copy link

tp971 commented Dec 27, 2023

When using Builder::append_path (or any of the append methods except append_link), if the file size changes during the archival, it will corrupt the archive. The GNU tar implementation seems to handle this by limiting the amount of bytes written to the archive in case the file got bigger, or padding it with zeroes if the file got smaller.

It is possible to work around this issue by calling append_data with a manually generated header and a wrapper around Read that limits the amount of bytes or returns padding zeroes, however it would be nice if this case is handled by tar::Builder.

@tp971 tp971 changed the title append_* methods corrupt archive when file size changes Builder::append_* methods corrupt archive when file size changes Dec 27, 2023
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

No branches or pull requests

1 participant