[PR #52] [MERGED] Tar long name support #814

Closed
opened 2026-01-29 22:17:42 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/52
Author: @sander2
Created: 4/7/2015
Status: Merged
Merged: 4/9/2015
Merged by: @adamhathcock

Base: masterHead: tar-long-name-support


📝 Commits (3)

  • 0886442 Tar: Support for writing long filenames (>100 chars) using longlink
  • 3113500 don't write trailing zero in WriteOctalBytes
  • 26ddc09 add unit test for writing tar archives containing long filenames

📊 Changes

2 files changed (+80 additions, -27 deletions)

View changed files

📝 SharpCompress.Test/Tar/TarArchiveTests.cs (+38 -0)
📝 SharpCompress/Common/Tar/Headers/TarHeader.cs (+42 -27)

📄 Description

Support for writing arbitrarily long filenames in tar archives.

The existing code used the ustar prefix field for supporting filepaths up to 255 chars (the actual maximum filepath length depends on the exact location of the slashes in the pat). However, there was a bug (several bugs, in fact) in the implementation that caused the filewriter to throw an error when a filepath of > 100 chars was used.
This pull request drops the use of the ustar prefix field in favor of the use of LongLinks. As far as I can tell, the use of LongLink is more common than the use of the ustar prefix field. Both 7zip and gnu tar use LongLinks by default.
Since the previous implementation never worked anyway, there are no users depending on the use of the ustar prefix field.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/52 **Author:** [@sander2](https://github.com/sander2) **Created:** 4/7/2015 **Status:** ✅ Merged **Merged:** 4/9/2015 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `tar-long-name-support` --- ### 📝 Commits (3) - [`0886442`](https://github.com/adamhathcock/sharpcompress/commit/088644240af9246c19db7261071f1b4d0f763a61) Tar: Support for writing long filenames (>100 chars) using longlink - [`3113500`](https://github.com/adamhathcock/sharpcompress/commit/3113500229346b01d34097d8c7c6cf6dff3f9f31) don't write trailing zero in WriteOctalBytes - [`26ddc09`](https://github.com/adamhathcock/sharpcompress/commit/26ddc09c6a9483391bc91e001dc5703040d13265) add unit test for writing tar archives containing long filenames ### 📊 Changes **2 files changed** (+80 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `SharpCompress.Test/Tar/TarArchiveTests.cs` (+38 -0) 📝 `SharpCompress/Common/Tar/Headers/TarHeader.cs` (+42 -27) </details> ### 📄 Description Support for writing arbitrarily long filenames in tar archives. The existing code used the ustar prefix field for supporting filepaths up to 255 chars (the actual maximum filepath length depends on the exact location of the slashes in the pat). However, there was a bug (several bugs, in fact) in the implementation that caused the filewriter to throw an error when a filepath of > 100 chars was used. This pull request drops the use of the ustar prefix field in favor of the use of LongLinks. As far as I can tell, the use of LongLink is more common than the use of the ustar prefix field. Both 7zip and gnu tar use LongLinks by default. Since the previous implementation never worked anyway, there are no users depending on the use of the ustar prefix field. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:17:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#814