[PR #422] [CLOSED] Tar symlink support #1018

Open
opened 2026-01-29 22:18:38 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/422
Author: @markfinal
Created: 11/1/2018
Status: Closed

Base: masterHead: tarsymlink


📝 Commits (3)

  • 192b9c1 Ref #248. Ref #132. Tar reader support for symlinks for .NET standard 2 and Posix platforms
  • d91e58f Refs #248. Refs #132. Added a test case of a tar containing symlinks
  • 3f43384 Removed unnecessary code

📊 Changes

12 files changed (+85 additions, -10 deletions)

View changed files

📝 src/SharpCompress/Common/Entry.cs (+5 -0)
📝 src/SharpCompress/Common/ExtractionMethods.cs (+24 -10)
📝 src/SharpCompress/Common/GZip/GZipEntry.cs (+2 -0)
📝 src/SharpCompress/Common/IEntry.cs (+1 -0)
📝 src/SharpCompress/Common/Rar/RarEntry.cs (+2 -0)
📝 src/SharpCompress/Common/SevenZip/SevenZipEntry.cs (+2 -0)
📝 src/SharpCompress/Common/Tar/Headers/TarHeader.cs (+7 -0)
📝 src/SharpCompress/Common/Tar/TarEntry.cs (+2 -0)
📝 src/SharpCompress/Common/Zip/ZipEntry.cs (+2 -0)
📝 src/SharpCompress/SharpCompress.csproj (+1 -0)
📝 tests/SharpCompress.Test/Tar/TarReaderTests.cs (+37 -0)
tests/TestArchives/Archives/TarWithSymlink.tar.gz (+0 -0)

📄 Description

I've been trying to use SharpCompress in my project, and encountered tar archives containing symlinks to be a problem for extraction, so I've tried to implement support for symlinks.

I'm expecting this will bounce back with rejections initially, as there are two holes that I've not filled:

  1. currently only supported on .NET standard 2.0 and above, due to the use of Mono.Posix.NETStandard nuget. I'm so far unable to find an equivalent for older versions.
  2. What to do on Windows when extracting a symlink.

Suggestions/recommendations for what to do here would be gratefully received.

I've added a test case, which is my initial use case - a source archive of the MoltenVK project on github, which contains symlinks. With local builds, and this PR, I can now use that archive in my project.


🔄 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/422 **Author:** [@markfinal](https://github.com/markfinal) **Created:** 11/1/2018 **Status:** ❌ Closed **Base:** `master` ← **Head:** `tarsymlink` --- ### 📝 Commits (3) - [`192b9c1`](https://github.com/adamhathcock/sharpcompress/commit/192b9c1e8bb36b76fb2b05ebd36918982bb1d6bf) Ref #248. Ref #132. Tar reader support for symlinks for .NET standard 2 and Posix platforms - [`d91e58f`](https://github.com/adamhathcock/sharpcompress/commit/d91e58f2cce50db1ea57017eeb6f613b7c088342) Refs #248. Refs #132. Added a test case of a tar containing symlinks - [`3f43384`](https://github.com/adamhathcock/sharpcompress/commit/3f4338489cb0311ced6b361c235a78c718ebd241) Removed unnecessary code ### 📊 Changes **12 files changed** (+85 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/Entry.cs` (+5 -0) 📝 `src/SharpCompress/Common/ExtractionMethods.cs` (+24 -10) 📝 `src/SharpCompress/Common/GZip/GZipEntry.cs` (+2 -0) 📝 `src/SharpCompress/Common/IEntry.cs` (+1 -0) 📝 `src/SharpCompress/Common/Rar/RarEntry.cs` (+2 -0) 📝 `src/SharpCompress/Common/SevenZip/SevenZipEntry.cs` (+2 -0) 📝 `src/SharpCompress/Common/Tar/Headers/TarHeader.cs` (+7 -0) 📝 `src/SharpCompress/Common/Tar/TarEntry.cs` (+2 -0) 📝 `src/SharpCompress/Common/Zip/ZipEntry.cs` (+2 -0) 📝 `src/SharpCompress/SharpCompress.csproj` (+1 -0) 📝 `tests/SharpCompress.Test/Tar/TarReaderTests.cs` (+37 -0) ➕ `tests/TestArchives/Archives/TarWithSymlink.tar.gz` (+0 -0) </details> ### 📄 Description I've been trying to use SharpCompress in my project, and encountered tar archives containing symlinks to be a problem for extraction, so I've tried to implement support for symlinks. I'm expecting this will bounce back with rejections initially, as there are two holes that I've not filled: 1. currently only supported on .NET standard 2.0 and above, due to the use of Mono.Posix.NETStandard nuget. I'm so far unable to find an equivalent for older versions. 2. What to do on Windows when extracting a symlink. Suggestions/recommendations for what to do here would be gratefully received. I've added a test case, which is my initial use case - a source archive of the MoltenVK project on github, which contains symlinks. With local builds, and this PR, I can now use that archive in my project. --- <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:18:38 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1018