[
  {
    "Id": "218715",
    "ThreadId": "64287",
    "Html": "<p>Hi,</p>\r\n<p>I am using the library 1.8.4.5 on my Windows CE 6.0 device. At the moment I am struggling with the following problem: All files which have been successfully extracted have the actual time (time of extraction)&nbsp;set as the Last Modified time.<br><br>In my source code I&nbsp;have checked the properties LastModified and Mtime of an affected ZIP entry during the&nbsp;<span style=\"font-size:x-small\">Extracting_BeforeExtractEntry event. At this time</span>&nbsp;Mtime is &quot;12:00:00 AM&quot; and LastModified is &quot;4/9/2009 12:31:32 PM&quot;.&nbsp; The property LastModified contains the correct DOS Last Modified time. The content of Mtime is not clear to me. I thought Mtime should be empty (if no NTFS time was available) or the same as LastModified? So the property LastModified contains the correct time, however DoNetZip does not use it.<br><br>During my tests I have found this topic:&nbsp; <span id=\"ctl00_ctl00_MasterContent_Content_TitleLabel\"><a title=\"SetLastWriteTime fails on Compact Framework\" href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=7944\">SetLastWriteTime fails on Compact Framework</a>. It seems to me that my problem is maybe related to this issue.</span><br><br>I apologize if this question has been answered but I have not been able to find any information on this error.<br><br>Regards Peter</p>",
    "PostedDate": "2009-08-03T04:03:23.397-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218725",
    "ThreadId": "64287",
    "Html": "<p>It's possible on WinCE for the SetLastWriteTime to fail.&nbsp; I have not understood the reasons for failure enough to prevent it.&nbsp; However, when it fails the change made for the workitem you cited was to NOT throw an exception if SetLastWriteTime fails.&nbsp; Instead, in this case DotNetZip will log a message to the StatusMessageTextWriter, describing the failure and the exact error code.&nbsp; This change was made for v1.8.3.9 of the library.&nbsp; If you are using v1.8.4.5, then you have the change.</p>\r\n<p>Therefore, at the moment the best I can suggest is to set the SMTW to a StringWriter to see if those messages are being logged. If they are being logged, we will have more information in the message to help troubleshoot the problem.</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>StringWriter sw = <span style=\"color:Blue\">new</span> StringWriter();\r\n<span style=\"color:Blue\">using</span> (ZipFile zip = ZipFile.Read(whatever))\r\n{\r\n  zip.StatusMessageTextWriter = sw;\r\n  <span style=\"color:Green\">// call Extract methods here ...</span>\r\n}\r\n\r\n</pre>\r\n</div>",
    "PostedDate": "2009-08-03T04:25:27.297-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218735",
    "ThreadId": "64287",
    "Html": "<p>Hi!<br><br>this is my output:<br><br><strong>Warning: SetLastWriteTime failed. entry(Liesmich.txt)&nbsp; file(\\Temp\\New folder\\Liesmich.txt) rc(87)<br><br></strong>Regards Peter</p>",
    "PostedDate": "2009-08-03T04:37:08.33-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218783",
    "ThreadId": "64287",
    "Html": "<p>Hi Cheeso,<br><br>I have just compiled the soure code&nbsp;from this ZIP file <a id=\"ctl00_ctl00_MasterContent_Content_ReleasePanelOrderingContainer_ReleaseFilesCtrl_FileList_ctl00_FileNameHyperLink\" tabindex=9 href=\"http://dotnetzip.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=23152#DownloadId=59118\">DotNetZip-src-v1.8.4.14.zip</a>&nbsp;and found the cause of&nbsp;the problem.&nbsp; In the file <strong>ZipEntry.cs</strong> (it's a part of the project &quot;Zip Partial DLL&quot;) there is&nbsp;the function<br><strong>SetLastWriteTime</strong>. This function calls the native API function <strong>CreateFileCE</strong> of CoreDll.dll:</p>\r\n<div style=\"color:Black;background-color:White\">\r\n<pre>IntPtr hFile  = (IntPtr) CreateFileCE(filename, \r\n          (<span style=\"color:Blue\">uint</span>)FileAccess.Write, \r\n          (<span style=\"color:Blue\">uint</span>)FileShare.Write, \r\n          0, \r\n          (<span style=\"color:Blue\">uint</span>) 3,  <span style=\"color:Green\">// == open existing</span>\r\n          (<span style=\"color:Blue\">uint</span>)0, <span style=\"color:Green\">// flagsAndAttributes </span>\r\n           0);<br></pre>\r\n<pre><br><br><br><br>If I replace the FileAccess enumeration <strong>FileAccess.Write</strong> and the FileShare enumeration <strong>FileShare.Write</strong> with the WinAPI constant values of GENERIC_WRITE (0x40000000L)<br>and FILE_SHARE_WRITE (0x00000002) the problem is fixed</pre>\r\n<pre style=\"color:Black;background-color:White\"><pre>IntPtr hFile  = (IntPtr) CreateFileCE(filename, \r\n      (<span style=\"color:Blue\">uint</span>)0x40000000L,  \r\n      (<span style=\"color:Blue\">uint</span>)0x00000002L, \r\n      0, \r\n      (<span style=\"color:Blue\">uint</span>) 3,  <span style=\"color:Green\">// == open existing</span>\r\n      (<span style=\"color:Blue\">uint</span>)0, <span style=\"color:Green\">// flagsAndAttributes </span>\r\n      0);\r\n</pre>\r\n</pre>\r\n</div>\r\n<pre>The values of the .NET enumerations do not match the values of the WinAPI constants.</pre>\r\n<pre>Regards Peter<br><br><br><br><br><br></pre>",
    "PostedDate": "2009-08-03T06:50:44.567-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218813",
    "ThreadId": "64287",
    "Html": "<p>Thank you Peter, very good fix.&nbsp;</p>",
    "PostedDate": "2009-08-03T08:18:30.647-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  },
  {
    "Id": "218814",
    "ThreadId": "64287",
    "Html": "This discussion has been copied to a work item. Click <a href=\"http://dotnetzip.codeplex.com/WorkItem/View.aspx?WorkItemId=8307\">here</a> to go to the work item and continue the discussion.",
    "PostedDate": "2009-08-03T08:21:35.417-07:00",
    "UserRole": null,
    "MarkedAsAnswerDate": null
  }
]