.Read exception - Bad date/time

Sep 18, 2009 at 9:48 PM
Edited Sep 18, 2009 at 9:56 PM

Good afternoon, 

 

I've seen a few discussions about this with this same exception, but it looks like I have a case that eludes the existing date validation in PackedToDateTime and would be easy to check for.

 

Here's the message:

Bad date/time format in the zip file. (y(2007) m(13) d(3) h(8) m(7) s(36))

 

StackTrace with Iconic.Zip v1.8.4.23:

   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress)

   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding)
   at Ionic.Zip.ZipFile.Read(String fileName)
   at ATT_Importer_WPF.ZipTools.ExtractAll(String source, String target) in C:\Users\Phil\Documents\Visual Studio 2008\Projects\ATT Importer WPF\ATT Importer WPF\ZipTools.cs:line 21

   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress)

   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding)

   at Ionic.Zip.ZipFile.Read(String fileName)

   at ATT_Importer_WPF.ZipTools.ExtractAll(String source, String target) in C:\...........

 

Stacktrace with Iconic.Zip v1.9.0.7:

   at Ionic.Zip.SharedUtilities.PackedToDateTime(Int32 packedDateTime)

 

   at Ionic.Zip.ZipEntry.ReadDirEntry(ZipFile zf)

   at Ionic.Zip.ZipFile.ReadCentralDirectory(ZipFile zf)

   at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)

   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress)

   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding)

   at Ionic.Zip.ZipFile.Read(String fileName)

   at ATT_Importer_WPF.ZipTools.ExtractAll(String source, String target) in C:\............

 

 

 

Looks like it is due to the fact that the month is > 12. 

 

If this is not a change you'd like to make, do you know of any way I can get around this? Perhaps a way to write over the existing zip file's embedded date/time before calling ZipFile.Read? (Unfortunately, correcting file's origin is not a realistic option)

Coordinator
Sep 19, 2009 at 1:31 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Sep 19, 2009 at 1:51 AM

try v1.9.0.9 to see if it works for you.

 

Sep 19, 2009 at 4:43 AM

1.9.0.9 works;

 

Thanks Cheeso!