Skip to content

archive/tar: document blocking factor of 1 #78037

@Andromelus-ng

Description

@Andromelus-ng

The archive/tar package uses a blocking factor of 1 when generating a tar archive.

However, while, I believe, not standard, (almost) everything uses a blocking factor of 20 by default (tested on git bash for windows and ubuntu 22.04) by default, resulting in a quite big file size difference.

Using tape is outdated (and blocking factor is made for this only if I understand correctly), so using 1 is not a problem. However, it can lead to a lot of confusion while comparing tar generated via the tar command (for example) and via go for the following reasons:

  • It is said in lot of places that default for most of tar tools is 20 for blocking factor (GNU doc, Wikipedia)
  • Blocking factor is never mentionned in the archive/tar docs and (obvisouly) not configurable either
  • One may not be familiar at first with the tar format

As a consequence, I propose that the archive/tar docs mention this somewhere, a simple phrase like:

Note that this package uses a blocking factor of 1 <link to blocking factor here ?>

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions