Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to extract a single file from a 7z compressed archive? #51

Open
breakind opened this issue Mar 4, 2024 · 4 comments
Open

Comments

@breakind
Copy link

breakind commented Mar 4, 2024

I'm using SevenZipEntryInfo to get the list of files in a 7z archive. Is there a way to unzip a specific file individually, rather than unzipping all files using the open method?

@tsolomko
Copy link
Owner

tsolomko commented Mar 4, 2024

No, currently there is no such functionality.

@breakind
Copy link
Author

breakind commented Mar 4, 2024

Are there plans for this in the future? It may be more appropriate in certain scenarios on mobile devices to operate on individual files separately, especially considering that some files are quite large and the time it takes to decompress all at once is extremely long.

@tsolomko
Copy link
Owner

While I appreciate the problem, that you have highlighted, in the case of 7-Zip it is a bit tricky to resolve. The issue is that 7-Zip contains inside of it not just files, but "streams" of data (in 7-Zip terminology). Each of the streams can contain the data for multiple files at the same time, and this combined data is compressed together. So, if you want to decompress data for only one file, most likely you will still end up decompressing data for multiple files (the entire stream), or in the worst case, for all the files in the archive.

So it may very well be impossible to speed up the extraction of a single file in the general case.

@breakind
Copy link
Author

Thank you very much for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants