How 7z choose extract format when using open inside / inside*
A free file archiver for extremely high compression
Brought to you by:
ipavlov
Hello Igor,
I have a sample file in the attachment. When I using 7z to open inside * (correspond to -t * ) the file, I found it open using VHD format to open the file, while when I use open inside the file, it using MBR format to open the file.
I would like to know in the 7z c++ code, which portion of code that pick the file format use to open/extract the file based on input parameters, when the file can be open/extract successfully by more than 1 format? I have tried to review the code but no luck so far.
-t*
opens only one level.7-zip by default opens all levels:
1) VHD
2) MBR
3) FAT
You can see all levels with Info button.
Hello Igor,
I would like to use "open inside", but I don't know which portion of code will cover the "open inside" feature. Could you please a block of code C++ of 7z demonstrate how to do it?
Thank you.
OpenArchive.h
CArchiveLink
Update to the question
In the code I found file OpenArchive.cpp, function Open(COpenOptions &op) when open inside, continuously checking for archive property "kpidMainSubfile" and by checking if the value from "kpidMainSubfile" < numItems => decide to check if the sub file inside the first file is the one we should open as "open inside".
I also read this ticket: https://sourceforge.net/p/sevenzip/discussion/45798/thread/dcea4192/ and it seem 7z.exe use "kpidMainSubfile" archive property to check if the sub file is main file, and should be open by "open inside". Am I right?
yes
Hello,
In the attachment I draw a simple flow chart to demonstrate to flow (that I understand) how 7z choose which kind of archive type we should use to open/extract the archive, when we use "open inside" feature.
Could you correct me if I were wrong?
Thank you very much!
OpenArchive.cpp is 3500 lines of code.
So there are some complex rules to handle with some cases like SFX archives. And I don't keep all these rules in my head.
It works as it works.
It's complicated.
Thank you very much for your support!