mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-06 21:26:07 +00:00
ArchiveEntry.Key is dependent on the archivetype #150
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @evpxregu on GitHub (Dec 10, 2016).
Originally assigned to: @adamhathcock on GitHub.
Hi,
When I run the following code the directory seperator in the IArchiveEntry.Key is different for different archive types.
Output for a .rar file:
output for a .zip file
Is this by design or a bug? Both archives are created on the same computer.
@adamhathcock commented on GitHub (Dec 10, 2016):
It seems likely there's a bug in creating where I hardcoded the path separator. I'm not sure I should use he OS's separator or always pick one.
The archive specs may have one specifically. I'll have to look it up.
@leezer3 commented on GitHub (Dec 11, 2016):
https://github.com/adamhathcock/sharpcompress/pull/114
You've got a hardcoded path separator issue in your RAR extractor
https://github.com/adamhathcock/sharpcompress/blob/master/src/SharpCompress/Common/Rar/Headers/FileHeader.cs#L168
Dumping the switch statement in favour of this ought to fix it:
RAR always wants a \ as it's path separator.
Note:
Haven't tested this on create, hence why I'm not running up a pull request, but I don't see any reason for it to fail.
@adamhathcock commented on GitHub (Dec 12, 2016):
I'll look into this soon. I was thinking archive formats want something specific and SharpCompress will have to adjust it one top of the formats like you're saying.
@adamhathcock commented on GitHub (May 22, 2017):
Finally made a PR for this https://github.com/adamhathcock/sharpcompress/pull/238