Compress with complete directory structure...

Aug 22, 2010 at 10:37 AM

Hello Markhor,

This is my 2nd post regarding maintain complete directory structure while compressing, This time i will explain in more detail about my requirement,hope this time you will help me.

Below is my code snippet:

string filePath = "c:\Windows\temp\samplefile.txt";

string outPath = "c:\samplearchive.7z";

public SevenZipCompressor cmp = new SevenZipCompressor();

cmp.PreserveDirectoryRoot = true;

cmp.CompressionMode = CompressionMode.Create;

cmp.CompressFiles(outPath, filePath);

when i extract samplearchive.7z i got 1 folder samplearchive and samplefile.txt inside.

What i want to know is that is it possible to preserve complete directory structure like:

when i extract samplearchive.7z i should get below folder structure

c -> Windows -> temp -> samplefile.txt

not as samplearchive - > samplefile.txt

please suggest is it possible or i am using older version to achive this functionality.

Thanks and Regards,
Abhijit

 

 

Aug 22, 2010 at 5:28 PM

hi Markhor...

i have solve the problem...thanx for a gr8 application...