7-zip: drag & drop "forgets" folder timestamps

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Filehero
Posts: 2292
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

7-zip: drag & drop "forgets" folder timestamps

Post by Filehero » 01 Feb 2019 08:44

HI,

I noticed when I drag & drop a compressed folder structure from 7-zip the original folder timestamps aren't restored whereas with deflating from 7-zip they are. Is this a general "restriction" of the drag & drop mechanism?


Thanks,
FH

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by admin » 10 Feb 2019 17:19

I'd say that's the responsibility of the receiving app. The paths are passed to it, so it can easily find out about the dates.

Filehero
Posts: 2292
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by Filehero » 10 Feb 2019 18:21

admin wrote:
10 Feb 2019 17:19
... of the receiving app.
XYplorer is the drop target, thus I assumed it would be XY's duty. But I don't know nothing about how drag & drop works under the hood.

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by admin » 10 Feb 2019 18:23

Whoops, did not read close enough. I'll check that...

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by admin » 11 Feb 2019 15:36

Seems to work here. I drag a folder with nested contents from 7zip to XYplorer, unpacking it from an archive. All original timestamps, also of the containted folders, are preserved. Misunderstanding?

No, wait, I saw something...

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by admin » 11 Feb 2019 16:49

Well, it looks like browsing a path the first time after its creation will reset its modified date to NOW. But this is only part of the truth since it is not the case in other contexts. Windows is doing something here that I have not seen before, probably something "smart". I will look at it again later. For now: Cannot stop this from happening. Same happens in Explorer, too, BTW. :|

Filehero
Posts: 2292
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by Filehero » 11 Feb 2019 17:57

Hi Don,

thanks for investigating. When I read about „smartness“ I fear the day OSes will become subject to AI. :naughty:

FH

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by admin » 11 Feb 2019 19:19

I my pathological urge to surpass Explorer I managed to add a workaround that, uhm, works around it, at least here. :) Let me know if it works for you as well. Next beta...

Filehero
Posts: 2292
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by Filehero » 11 Feb 2019 23:01

Seems not to be fixed with 19.60.0101, and it appears to be even more complicated as the behavior is somewhat different depending on what folder (hierarchy) is used as the drop source.

1. When I drag&drop the (single) root folder (which is XY's data folder):
For the root folder in the archive creation time is restored, modified time not. For the children folders (AutoBackup etc.) either timestamps aren't restored.

2. When I drag&drop the 1st order children (AutoBackup etc.) their creation time is not restored, modified time however is (so it's the opposite behavior of 1.).

From my visual observations on the 1st order children (AutoBackup etc) it seems that 7-zip is restoring the archived folders with the original creation date and then doing an update of the modified date in a "second pass" because at first XY shows the latter with age of 0 or 1s.

I could send you my archive file if required tomorrow.

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by admin » 12 Feb 2019 07:25

The archive creation time? Why should that be restored in the extracted contents?

AFAIK, archives don't store the Created Date but only the Modified Date of their contents. And I agree one could expect to have that date preserved after extraction. According to the laws of Windows, the Modified Date of a folder is updated when its contents are changed, hence you see the top folders Modified Date set to NOW (it does not happen with subfolders though, which makes the whole thing look like a Windows bug, like they forgot to actively restore the date in the top level folders). However, in the recent beta, XYplorer works around this. At least here this works well with Zip, 7zip and WinRAR archives.

Just to make sure: What I'm testing here is dragging things out of an archive into XYplorer.

Filehero
Posts: 2292
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by Filehero » 12 Feb 2019 09:12

admin wrote:
12 Feb 2019 07:25
The archive creation time?
No the folders creation time, at least 7-zip does.
folder_ts.png
folder_ts.png (20.2 KiB) Viewed 282 times
admin wrote:
12 Feb 2019 07:25
AFAIK, archives don't store the Created Date but only the Modified Date of their contents
See screenshot above.
admin wrote:
12 Feb 2019 07:25
Just to make sure: What I'm testing here is dragging things out of an archive into XYplorer.
This is what my qestion is about. On Win 10 and 7 after extraction by drag&drop from 7-zip the creation time from the archive isn't restored but instead set to now.

It's no biggie just something I didn't understand, hence I was asking.

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by admin » 12 Feb 2019 09:18

I have old versions of WinZip and WinRAR, that explains the difference in stored data. Maybe also the difference in the results of the fix.

If it does not work with newer versions I can as well remove the "fix".

So, bottomline: Can't help it. :|

Filehero
Posts: 2292
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: 7-zip: drag & drop "forgets" folder timestamps

Post by Filehero » 12 Feb 2019 09:56

admin wrote:
12 Feb 2019 09:18
If it does not work with newer versions I can as well remove the "fix".
I would leave it in, so that users of the older versions will benefit.
admin wrote:
12 Feb 2019 09:18
So, bottomline: Can't help it. :|
Never mind! Thanks for helping. :)

Post Reply