Reputation: 491
I just faced with the next problem. I need to get CRC data of files in packed archive 7z. I have found docs (http://www.7-zip.org/recover.html) that describes how is 7z works with integrity of the packages but unfortunately I didn't found answer.
Do you have any ideas how to get CRC file's data from packed 7zip archive without unpacking it?
Upvotes: 4
Views: 3559
Reputation: 51
7z l -slt archive.zip
should list extended info for the files in the archive, including CRC if it was added at the creation time
Upvotes: 5
Reputation: 2700
if you are asking this here at SO I understand you want to do it programmatically.
OK just get the file Client7z.cpp from 7z source code. That file creates Client7z.exe which is able to list the files in a 7z file. If you see the code it is easy to also list the CRC by just adding
{
// Get CRC of a file
NWindows::NCOM::CPropVariant prop;
archive->GetProperty(i, kpidCRC, &prop);
UString s = ConvertPropVariantToString(prop);
PrintString(s);
PrintString(" ");
}
with this info you could also quickly code your own application based on Client7z.cpp fitting only your specific needs.
Upvotes: 2