You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
tp971
changed the title
append_* methods corrupt archive when file size changesBuilder::append_* methods corrupt archive when file size changes
Dec 27, 2023
When using
Builder::append_path
(or any of the append methods exceptappend_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 aroundRead
that limits the amount of bytes or returns padding zeroes, however it would be nice if this case is handled bytar::Builder
.The text was updated successfully, but these errors were encountered: