mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
compatibility with non-standard zip formats #651
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 @Qeynos on GitHub (Aug 8, 2024).
I have an old zip file that may not have been created following the standard specifications. When I use SharpCompress to decompress it, the backslash character is merged with the file name, causing the extracted files to have incorrect paths, such as "/home/test/storage\first\error.jpg". I need to use code like this to solve the problem. I wonder if there has been any consideration for compatibility with non-standard zip formats.
@adamhathcock commented on GitHub (Aug 8, 2024):
the slashes are just the key name and is OS independent really. The Path.Separator should be OS specific and could be used to figure that out but not everyone wants the keys to be automatically converted.
@Qeynos commented on GitHub (Aug 8, 2024):
In Linux, the 'storage\first\error.jpg' in a non-standard zip file is considered to be a filename without a path. Even if you use Path.Combine to combine entry.Key with the path, it will not correct this error.
@adamhathcock commented on GitHub (Aug 12, 2024):
Like I said, this is a key that is the same on all platforms with those slashes....a zip is a series of key/values.
The slash being different across platforms is an implementation detail you need to fix yourself or use a helper method to convert them.