-1 returned from ZipEntry.ExternalFileAttributes
See original GitHub issueSteps to reproduce
- Zip a file on Linux using Info-Zip
- Unzip using the library
- Try to retrieve the file permissions
int unixFilePermission = zipEntry.ExternalFileAttributes;
Expected behavior
unixFilePermission returns the right int value
Actual behavior
ExternalFileAttributes returns -1 for all extracted files (zip entry)
Version of SharpZipLib
1.3.3
Obtained from (only keep the relevant lines)
- Package installed using NuGet
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
ZipInputStream (Java SE 17 & JDK 17)
This class implements an input stream filter for reading files in the ZIP file format. Includes support for both compressed and uncompressed entries....
Read more >Does a ZipEntry persist after a ZipFile is closed?
I currently have a plausible resource leak in my library due to the fact that I hold a ZipFile open so that the...
Read more >mono/ZipEntry.cs at main
ZipFile and ZipInputStream will give you instances of this class as ... int externalFileAttributes = -1; // contains external attributes (os dependant).
Read more >zipfile — Work with ZIP archives
Return a list containing a ZipInfo object for each member of the archive. The objects are in the same order as their entries...
Read more >Class ZipEntry | SharpZipLib Help
This class represents an entry in a zip archive. This can be a file or a directory ZipFile and ZipInputStream will give you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not anything I tried, but the central directory is at the very end, so you could make a custom stream wrapper that buffers the reads and permits seeking within the last BUFFER_SIZE bytes. That way you could just open the stream with
ZipFile
after the last entry has been read, iterate over the entries and just update the permissions.I think that would work. Reading the data wouldn’t work of course, but as long as you allow the seeks, the iteration of the entries should work…
Thanks In my case, I’m trying to extract and parse data immediately without needing to wait for the ZIP file to buffer. because of the structure of zip archive format, I believe zip permission cannot be retrieved in real-time.
Do you think there is a way to check the point to central directory to retrieve permission while I’m streaming a zip archive?