datetime of dir with sub-dirs may error in 7z plugins

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
dllee
Junior Member
Junior Member
Posts: 62
Joined: 2011-04-09, 12:29 UTC
Location: Taiwan
Contact:

datetime of dir with sub-dirs may error in 7z plugins

Post by *dllee »

I have tried the following 7z plugins:
7zip 0.6.4 plugring/7Zip.html
Total7zip 0.8.4.1 plugring/Total7zip.html

my wincmd.ini
[PackerPlugins]
7z=735,%COMMANDER_PATH%\Plugins\wcx\Total7zip\Total7zip.wcx
7zip=223,%COMMANDER_PATH%\Plugins\wcx\7zip\7zip.wcx

Test procedure:
1. create dir C:\R0401
create dir C:\R0401\S10402
create dir C:\R0401\S20404
create dir C:\R0401\S30403

2. set datetime of the dir
C:\R0401 to 2011-04-01
C:\R0401\S10402 to 2011-04-02
C:\R0401\S20404 to 2011-04-04
C:\R0401\S30403 to 2011-04-03

3. select C:\R0401 and press Alt+F5 to compress the dir
select 7z to test Total7zip (R0401.7z)
and again select 7zip to test 7zip (R0401.7zip)

4. View R0401.7z by Total7zip, the datetime of dir \R0401 is 2011-04-03
view R0401.7zip by 7zip, the datetime is the same 2011-04-03
but should be 2011-04-01

and I found the datetime of the dir will be the same as its last sub dir's datetime, for both 7zip and Total7zip. And if you extract the file, the output directory \R0401 will have the wrong datetime 2011-04-03.

But if you use 7zFM.exe (7z file manager) the view R0401.7z or R0401.7zip, the datetime information is correct, the \R0401 is 2011-04-01, also extract from 7zFM.exe will have the correct datetime for the output directory \R0401.

I thought it might be bugs in the plugins for viewing & extracting the 7z format files, so I debug the source of the 7zip (found in plugring/7Zip.html), and found the 7zip plugins (ReadHeaderEx) return the correct datetime of the dir \R0401 with 2011-04-01, but finally TotalCmd shows its datetime to 2011-04-03 (the same datetime as the last dir \R0401\S30403 ) ??!! why?

Is this a bug of Total Commander? or the plugins?
User avatar
petermad
Power Member
Power Member
Posts: 16031
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

I can not fully confirm your observations.

If I make the dirs with the timestamps as you describe, then datetime of dir \R0401 inside the archive when shown with TC is 2011-04-04 - not 2011-04-03 as you describe.

I noticed another thing tough. If I have set the file sorting in TC to Unsorted - then the three subdirectories is shown in reversed order: S20404, S20403, S20402 inside the archive when viewed in TC, even though they are in the opposite order on the source drive (both FAT and NTFS).

I have tested with:
Win XP SP3 and Win 7 x64 SP1.
Original directories placed both on FAT32 and NTFS filesystems.
Total7zip 0.8.4.0 and 7zip 0.7.5.0 plugins.
Solid and non-solid archives.

I can confirm that /zip File Manager shows the correct date 2011-04-01 for dir \R0401.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
dllee
Junior Member
Junior Member
Posts: 62
Joined: 2011-04-09, 12:29 UTC
Location: Taiwan
Contact:

Post by *dllee »

Please test it again with

1. create dir C:\R0401
create dir C:\R0401\S10402
create dir C:\R0401\S20404
create dir C:\R0401\S30403

2. set datetime of the dir
C:\R0401 to 2011-04-01
C:\R0401\S10402 to 2011-04-02
C:\R0401\S20404 to 2011-04-04
C:\R0401\S30403 to 2011-04-03

then the result will be the same as I tested.

As you mentioned about file Unsorted, I found when I debug the 7zip, TC query filename via ReadHeaderEx(), and the plugins return filename in reversed order. I don't know, maybe 7z format keep the filename in reversed order, so the plugins return the filename in reversed order. And I test 7zFM.exe to compress the dir \R0401 and then extract, the filename is also in reversed order, so when using 7z backup, means you don't want to keep the original unsorted file order. But, at least, I need correct datetime, please help...
User avatar
petermad
Power Member
Power Member
Posts: 16031
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

create dir C:\R0401\S10402
create dir C:\R0401\S20404
create dir C:\R0401\S30403
Sorry - I overlooked the different number right after the S. I have now tried again, and I can confirm the bug as described by you.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
dllee
Junior Member
Junior Member
Posts: 62
Joined: 2011-04-09, 12:29 UTC
Location: Taiwan
Contact:

Post by *dllee »

Thanks for your confirmation.

When I debug, TC view/extract 7z format file, in this case, in following order:

\R0401\S30403 -> TC creates \R0401 and \R0401\S30403 with datetime 2011-04-03

\R0401\S20404 -> TC creates \R0401\S20404 with datetime 2011-04-04

\R0401\S10402 -> TC creates \R0401\S10402 with datetime 2011-04-02

\R0401 -> TC bypass creating directory, because the dir already exist, and the datetime info is not updated.

So, the datetime of the \R0401 will be the same as its first sub-dir \S30403 recorded in 7z, and the 7z store the filename/dir in reversed order, i.e., the datetime of the dir will be the same as its last sub dir's datetime.

This bug should be fixed by TC or the plugins?
User avatar
dllee
Junior Member
Junior Member
Posts: 62
Joined: 2011-04-09, 12:29 UTC
Location: Taiwan
Contact:

Post by *dllee »

I'm trying to modify the source of 7zip to fix the problem...

It works when I reorder the directory list :D

new version of 7zip will be release on the post
http://ghisler.ch/board/viewtopic.php?t=18178
User avatar
dllee
Junior Member
Junior Member
Posts: 62
Joined: 2011-04-09, 12:29 UTC
Location: Taiwan
Contact:

Post by *dllee »

7zip 0.7.6.0 released

This bug is fixed :D
Post Reply