ZipFile.extract methods obsolete?

Dec 15, 2009 at 2:55 PM

Warning 1 'Ionic.Zip.ZipFile.Extract(string)' is obsolete: 'Please use method ZipEntry.Extract()' 

Version 1.8.4.28

Am I missing something here?

It seems the ZipEntry.Extract method is not as flexible

Im trying to unzip a file to a specific directory

 

 

Coordinator
Dec 15, 2009 at 5:00 PM

yes, obsolete. In what regard is ZipEntry.Extract() not as flexible?

ZipEntry.Extract(directory)  works, no?

 

Dec 15, 2009 at 5:34 PM

Here is a sample of what I am trying to do...Im trying to zip directory D:\ExtData into a zip file then at a later time unzip this file

to D:\Test directory

<font size="2" color="#008080"><font size="2" color="#008080">

ZipFile

</font></font><font size="2" color="#008080">

 

</font>

zip = new ZipFile();

<font size="2">

zip.AddDirectory(

</font>

"D:\\ExtData");

<font size="2">

zip.Save(

</font>

"D:\\Data\\Test.zip");

Works Great.... But..Next?

 

//ZipFile unzip1 = ZipFile.Read("D:\\Data\\Test.zip");

//unzip1.Extract("D:\\TestDir");

//ZipEntry unzip1 = new ZipEntry();

//unzip1.Extract("D:\\Data\\Test.zip");

 

Dec 15, 2009 at 6:42 PM

After continued attempts I finally got it....

ZipFile zip = new Zipfile();

zip.AddDirectory("D:\\ExtData");

zip.Save("D:\\Data\\Test.zip");

--- All good to this pint -----

-- To unzip later ----

ZipFile unzip1 = ZipFile.Read("D:\\Data\\Test.zip");

foreach(ZipEntry test1 in unzip1)

    test1.Extract(D:\\TestDir");

---All Files & SubDirectory extracted as expected-----

Thanks for work on this...I am just getting started with this..I will be expanding my usage of this code...

 

Coordinator
Dec 15, 2009 at 6:58 PM

Great, glad you got it sorted!

I'm glad to help.