Multivolume Archive Functionality

Aug 17, 2009 at 6:47 PM

Hi,

Firstly, great job wrapping the excellent functionality provided by 7zip. Really nice to be able to add functionality like this really quickly.

There is some functionality regarding multi-volume archives that I am wondering whether or not it is possible:

1) Testing whether all files of a multivolume archive exist without having to test by trying to extract the file and catching an error.

2) Obtaining the list of all files of a multivolume archive given one of the files.

3) Obtaining the filename of the "main" archive file of a multi volume archive (i.e., the one that ends "part1.rar" or ".rar" (not "r00", etc)

 

Are any of these possible?

 

Thanks,

Alex

Coordinator
Aug 21, 2009 at 10:55 AM

Hi Alex,

thanks for your kind words.

1) - easy, will be done;

2)Do you mean you specify not the first volume but I say second or third? Is the list of archive files is incomplete in multivolume rar archives?

3) - easy, will be doen.

Regards,

Vadim.

Coordinator
Sep 1, 2009 at 10:45 PM

Regarding the first feature, due to the specific multivolume 7zip implementation, one can't determine whether all volumes exist during open (that is, in SevenZipExtractor constructor). You have to call Check() to ensure the archive is valid.

 

Coordinator
Sep 1, 2009 at 10:47 PM

As for the third feature, one has to pass the main rar to the SevenZipExtractor constructor. Correct me if i'm wrong.

 

Sep 2, 2009 at 9:35 AM

Thanks Markhor, apologies for the belated reply!

2)Do you mean you specify not the first volume but I say second or third? Is the list of archive files is incomplete in multivolume rar archives?


I am unfamiliar with the structure of the files and what metadata they contain, but what I was after was a way to determine the list of filenames needed to extract a multivolume archive given one of the files. Not sure if this is possible. For example:

 

List<string> filenames = GetFilesNeededForArchive(@"c:\data.r03"); // Should return "c:\data.rar","c:\data.r00","c:\data.r01","c:\data.r02","c:\data.r03","c:\data.r04"...
List<string> filenames = GetFilesNeededForArchive(@"c:\data.rar"); // Should return the same as above.

 

 

Regarding the first feature, due to the specific multivolume 7zip implementation, one can't determine whether all volumes exist during open (that is, in SevenZipExtractor constructor). You have to call Check() to ensure the archive is valid.

Ok, thanks. Check() essentially does an extract and discards the uncompressed data, correct?

As for the third feature, one has to pass the main rar to the SevenZipExtractor constructor. Correct me if i'm wrong.

My problem is that it is difficult to know which is the main rar file programmatically. Yes, I can always do some logic like "if matches regex for "(FILE).part01.rar" select "(FILE).rar" if matches regex for "(FILE).r[0-9]*" select "(FILE).rar" but I was just wondering if there was an easy way to do this, which would be future proof (in case some other naming scheme becomes convention (001, 002, ... for example).

Thanks!
Alex

Coordinator
Sep 2, 2009 at 11:45 AM

Ok, thanks. Check() essentially does an extract and discards the uncompressed data, correct?

7zip has special "test" mode in IInArchive.Extract() COM item. I am not sure about files are even extracted, but if they do, uncompressed data is discarded.

Check() is an analogue to "t: Test integrity of archive" console 7z.exe command line option.

Coordinator
Sep 2, 2009 at 12:56 PM

I added VolumeFileNames to Extractor.

Sep 2, 2009 at 3:42 PM

Thanks a lot!