Overview
Features
Download
Documentation
Community
Add-Ons & Services

Zip::Decompress::decompressAllFiles()...

Discussion of ideas for features and new projects based on POCO.

Zip::Decompress::decompressAllFiles()...

Postby dnebing » 04 Feb 2011, 00:50

I'd think this method should also restore the last modified timestamps...

Granted this is easy enough to do using the callback facility, but I'd expect decompressAllFiles() to restore everything it can and use the callback to make whatever adjustments I need to...
dnebing
 
Posts: 8
Joined: 03 Feb 2011, 21:42

Re: Zip::Decompress::decompressAllFiles()...

Postby dnebing » 04 Feb 2011, 19:18

I submitted a patch to do this to the poco@pocoproject.org email address.
dnebing
 
Posts: 8
Joined: 03 Feb 2011, 21:42

Re: Zip::Decompress::decompressAllFiles()...

Postby dnebing » 04 Feb 2011, 19:25

Here's the patch against 1.4.1:

Code: Select all
diff -crB Zip/src/Decompress.cpp ZipDecomp/src/Decompress.cpp
*** Zip/src/Decompress.cpp   2011-01-31 11:13:12.000000000 -0500
--- ZipDecomp/src/Decompress.cpp   2011-02-04 12:11:51.448119300 -0500
***************
*** 158,163 ****
--- 158,167 ----
           return false;
        }
 
+       // New file has been created, but we should restore the timestamp to make it match what was defined in the header
+       Poco::DateTime dt = hdr.lastModifiedAt();
+       file.setLastModified(dt.timestamp());
+       
        std::pair<const ZipLocalFileHeader, const Poco::Path> tmp = std::make_pair(hdr, file);
        EOk.notify(this, tmp);
     }
dnebing
 
Posts: 8
Joined: 03 Feb 2011, 21:42

Re: Zip::Decompress::decompressAllFiles()...

Postby dnebing » 05 Feb 2011, 05:10

Sorry, that line should read "aFile.setLastModified()" not "file.setLastModified()"... My bad :cry:
dnebing
 
Posts: 8
Joined: 03 Feb 2011, 21:42


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest