bala3569
bala3569

Reputation: 11010

lastwritetime is changing while extracting a zipfile in c#?

While extracting a winzip file through code,Lastwritetime is changing in seconds...

Actual file Lastwritetime:4/8/2010 2:29:03PM
After zipping that file using winzip and while extracting that file using the code,actual files Lastwritetime changes to 4/8/2010 2:29:04PM...Is there any fix for this??? Here is my code...

                Chilkat.Zip zip = new Chilkat.Zip();
                bool unlocked = zip.UnlockComponent("30-day trial");
                if (!unlocked)
                {
                    MessageBox.Show(zip.LastErrorText);
                    return;
                }

                bool success = zip.OpenZip(inputFolderPath);
                if (!success)
                {
                    MessageBox.Show(zip.LastErrorText);
                    return;
                }
                long count = zip.Unzip(outputFolderPath);
                if (count == -1)
                {
                    MessageBox.Show(zip.LastErrorText);
                }
                else
                {
                    MessageBox.Show("Unzipped Successfully!");

                }

Upvotes: 1

Views: 209

Answers (2)

Theo
Theo

Reputation: 6083

This is probably an issue with the library code. Try contacting the vendor to see if they can fix it or alternatively switch to another component. If you don't need a managed solution and want faster compression you can try a native solution like Bricolsoft Zip ActiveX. http://www.bricolsoft.com/zip-activex-component.html.

Upvotes: 0

TBohnen.jnr
TBohnen.jnr

Reputation: 5119

This must be an issue with the zip library itself. try using sharpZiplib, i've used it a couple of times and works like a charm. http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx

Upvotes: 1

Related Questions