in reply to Re^8: Archive::Zip Modify Date Oddity
in thread Archive::Zip Modify Date Oddity
Sure. Starting with a file where the seconds field of the modification time is an odd number.
$ stat abc | grep Mod Modify: 2017-01-09 15:41:05.405778746 +0000
Now add that file into a zip archive.
$ perl -M'IO::Compress::Zip qw(zip)' -e ' zip "abc" => "abc.zip" '
unzip in a different directory
$ cd out $ unzip ../abc.zip
And stat the uncompressed file
$ stat abc | grep Mod Modify: 2017-01-09 15:41:05.000000000 +0000
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Archive::Zip Modify Date Oddity
by hippo (Archbishop) on Jan 11, 2017 at 10:00 UTC | |
(++ for the sample). Interestingly, I see the other reported behaviour where the mtime is rounded down to even seconds:
Versions are:
And this from "unzip -v":
I'm wondering if maybe it's something in the unzip. Is there a simple way to query the entries in the zipfile to see what its contents are to the resolution of seconds? (I never use zip/unzip so this is all beyond my realm) | [reply] [d/l] [select] |
by Anonymous Monk on Jan 13, 2017 at 20:08 UTC | |
I think it's a bug in the unzip utility. Slackware has (prematurely?) enabled the -DIZ_HAVE_UXUIDGID option when compiling the package and this causes the breakage. The option does not show up on "unzip -v" either. In unzip60 sources, process.c:2909 That results in dos time fields being used instead of unix. I have no idea if there's a bugreport or a fix available somewhere. Just my 10 min debug. HtH. | [reply] [d/l] [select] |
by pmqs (Friar) on Jan 11, 2017 at 11:44 UTC | |
I'm running exactly the same version of unzip & it works fine. To get more details on the zip file, try running
See my first reply dated today for what you need to look for in the output. Also - IO:Compress comes with a script called zipdetails that dumps lots of details on the fip file. If you happen to have available that try running this. The thing to look for is the "Extended Timestamp" entry
| [reply] [d/l] [select] |
by hippo (Archbishop) on Jan 11, 2017 at 12:18 UTC | |
Very interesting. Here's what zipinfo tells me:
So the "UT extra field modtime" entries are there and show the 1 second difference. I wonder why unzip isn't respecting that. Here's what I see from zipdetails:
and again the correct times are present as the "Extended timestamp" entries. So inspection suggests that the zipfile is OK but unzip is ignoring the extended attributes. | [reply] [d/l] [select] |
by pmqs (Friar) on Jan 11, 2017 at 15:19 UTC | |
by hippo (Archbishop) on Jan 11, 2017 at 16:14 UTC | |
| |