ExtractFile(String, String) not behaving

Apr 6, 2009 at 3:54 PM

Hello -

I started implementing SevenZipSharp last week, and have run into a bit of an issue.

After using ExtractFile(String, String) in a loop, where I ask the library to pull out a series of filenames to a destination directory, it seems to be pulling out all files in the archive, not just the ones I ask for.

I.e. 14 files in the archive, I have a list of 13 I want to extract, but I end up with all 14 files in my destination directory.

Skimmed through the forums and couldn't see anything related to this - I'm not misusing the method, am I?



Apr 6, 2009 at 7:08 PM
Edited Apr 6, 2009 at 7:09 PM

If you extract 7-zip archives, pay attention to the fact that 7-zip archives are solid, so that if you want to extract the last file, all the rest before it have to be extracted either. ExtractFile uses the old approach to deal with this problem, which extracts all the files before the specified one on the disk and then deletes them. In your case they were not deleted. Now I see that i should use the other method (FakeStream) without any extraction on disk. Thanks for the hint.
Apr 6, 2009 at 7:36 PM

Thanks for the quick reply, markhor.

If I understand your post correctly, you suggest calling ExtractFile(String, Stream) and then saving the Stream object to disk?



Apr 6, 2009 at 7:49 PM
kez, method ExtractFile(String, Stream) already uses the "modern" logic and works without writing anuthing on disk.

I have to make ExtractFile(String, String) work the same (it is outdated).

Will make it in 15 minutes :)
Apr 6, 2009 at 8:16 PM
Fixed. Check SVN.
Apr 6, 2009 at 8:17 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 6, 2009 at 8:35 PM
markhor - fantastic, thank you very much.