Cannot write Tar Header directly #494

Open
opened 2026-01-29 22:12:54 +00:00 by claunia · 1 comment
Owner

Originally created by @anaisbetts on GitHub (Feb 17, 2022).

I'm trying to process an existing Tar Archive but mutate some of its properties (specifically, fix up its paths) - I can't expand and recompress the archive, because some important UNIX-only attributes would be lost by writing it to a Windows filesystem.

TarWriter does not allow you to pass a TarHeader structure directly to TarWriter.Write, which means that certain POSIX attributes like the userId or groupId cannot be set

Originally created by @anaisbetts on GitHub (Feb 17, 2022). I'm trying to process an existing Tar Archive but mutate some of its properties (specifically, fix up its paths) - I can't expand and recompress the archive, because some important UNIX-only attributes would be lost by writing it to a Windows filesystem. `TarWriter` does not allow you to pass a `TarHeader` structure directly to `TarWriter.Write`, which means that certain POSIX attributes like the `userId` or `groupId` cannot be set
Author
Owner

@adamhathcock commented on GitHub (Feb 21, 2022):

What you're asking for seems a bit odd but there's no reason not to allow it I guess. The Tar implementation isn't the best so some rework might be needed to do what you're wanting to achieve.

Though, I'm not sure what's compressed here because if you can read the Tar information, it's not compressed. Tar itself is just a a HEADER/BLOB key value pair type of thing so nothing is compressed. Of course, I could be missing something.

@adamhathcock commented on GitHub (Feb 21, 2022): What you're asking for seems a bit odd but there's no reason not to allow it I guess. The Tar implementation isn't the best so some rework might be needed to do what you're wanting to achieve. Though, I'm not sure what's compressed here because if you can read the Tar information, it's not compressed. Tar itself is just a a HEADER/BLOB key value pair type of thing so nothing is compressed. Of course, I could be missing something.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#494