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: Note that append_dir_all doesn't hardlink #368

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ impl<W: Write> Builder<W> {
/// Also note that after all files have been written to an archive the
/// `finish` function needs to be called to finish writing the archive.
///
/// # Hardlinks
///
/// This function will never create hardlinks; to do that, you will
/// need to implement a custom recursive walk.
///
Copy link
Contributor

Choose a reason for hiding this comment

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

Not the maintainer (thanks for the review of my PRs!). I'm also a newb when it comes to a lot of the details of tar implementations and details. Leaving a comment here so you can dismiss/hide it and it won't take up space on the main thread.

  1. What is the behavior when it encounters hardlinks? Will it copy them like Add doc hint that default is different than tar #366? Would it make sense to spell out what "never create[ing] hardlinks" means in practice? I would appreciate that info when viewing the docs.
  2. Do you know if that behavior is intentional or accidental? I.e. Could this perhaps be a bug to be fixed rather than a behavior to be documented? Genuine question.
  3. If it's intentional, could adding a method to the builder like preserve_hardlinks(bool) be a way forward?

My goal here is to better understand the library and its existing behavior and to explore and understand the possibility of ways we could improve this library or possibly the PR.

/// # Examples
///
/// ```
Expand Down