1

How can I compare the local folder with a 7z archive?

The content should be compared and verified with file differences.

The archive is huge, extract and compare is not an option in this case.

2
  • not by using standard tools. This is possible using python or perl.
    – Rinzwind
    Commented Jan 15, 2023 at 16:02
  • You could use a python script to achieve the comparison, however the 7z archive file will still need to be extracted first, all done by the script. Commented Feb 9, 2023 at 10:26

3 Answers 3

3
+100

fuse-7z is an option

fuse-7z -r archivetest.7z /mnt/7zreadonly

fuse-7z will mount the 7z file as a readonly file system, then you can do you compare.

Fuse-Archive at https://github.com/google/fuse-archive can also mount 7z Files.

2

It's not possible to compare the differences in the contents of the 7z file, with the differences in the contents of the local folder, unless the 7z file is extracted. That's a side effect of lossless compression: side-by-side comparison with uncompressed data is not possible.

You can look inside the 7z archive to see hashes of individual files, but you cannot determine exactly which bytes inside that file are different from that same file outside the archive. That's the side effect of a hash checksum: the data can only be integrity verified using it, not that it is encrypted & you can decrypt it using the hash checksum to get the data itself back from just that. I assume this is not what you want either.

So the last alternative, if you are unable to extract the huge 7z archive, you can archive the local folder again, creating another huge 7z archive I assume, & compare hash of that with hash of the 7z file in question, & that will tell you if there is a difference between them, but not what those differences are, as again, that is not possible given your scenario restrictions.

0

Then you must extact each file separately and verify them one by one. Scripting ability required.

3
  • I was thinking that he mean "extract all files at once". Commented Jan 16, 2023 at 1:13
  • The archive is huge is probably why 2IRN doesn't want to extract it.
    – karel
    Commented Jan 16, 2023 at 1:18
  • But he can extract one by one file and check them all. It will be slow, but should work. Commented Jan 16, 2023 at 1:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .