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

[Feature Request]: Can we preview files layer by layer like zlib #158

Open
1 task done
psvajaz opened this issue Jul 27, 2023 · 3 comments
Open
1 task done

[Feature Request]: Can we preview files layer by layer like zlib #158

psvajaz opened this issue Jul 27, 2023 · 3 comments
Assignees

Comments

@psvajaz
Copy link

psvajaz commented Jul 27, 2023

Feature description

Can we preview files layer by layer like zlib

Additional context

No response

Code of Conduct

@rikyoz
Copy link
Owner

rikyoz commented Jul 27, 2023

Do you mean previewing the content of the tarball inside tar.bz2 or tar.gz archives without having to extract the outer archive?
Unfortunately, bit7z doesn't support this feature at the moment.
7-zip doesn't provide such functionality out-of-the-box, and it's not easy to implement it, but I'll definitely work on it for the v4.1.

@psvajaz
Copy link
Author

psvajaz commented Jul 28, 2023

I'm not just talking about the preview in tar.bz2 format, but I hope that any 7z supported file can work like zlib. I pass in the path of a compressed package file, and bit7z returns all the files and folders under this path, displaying the compressed and uncompressed sizes of the folders. This function is similar to the preview mode of 7zFM.

My current preview function is to obtain the file size of the compressed package through the BitArchiveReader function, and use recursive loops to count the compressed and uncompressed sizes of all files in each folder subset, which is relatively slow in efficiency.

It was found in the development that the compressed package in some formats only provides the complete path of the files in the compressed package, and does not contain directory information. It is necessary to run traversal logic to determine whether directory information exists in the file list after obtaining the file list through BitArchiveReader. If not, it is necessary to create directory information in the cache list and recursively calculate the file size. Only in this way can it be provided to the UI for display and processing.

@rikyoz
Copy link
Owner

rikyoz commented Jul 29, 2023

I see. This is a different feature than the one I described before.

At the moment, bit7z provides only the item metadata that the 7-zip DLLs offer, nothing more.

I guess the 7zFM GUI performs further processing for calculating each folder's size when such metadata is not already available in the archive format.
I don't know how the GUI implements this; I need to investigate this.

Also, in some cases, the size metadata is not provided even by 7zFM, e.g., when the archive uses solid compression.

Anyway, I'll evaluate how to provide such information, considering that this should not add any relevant overhead for the library users not interested in calculating/retrieving such information.

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

No branches or pull requests

2 participants