Page 1 of 1

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

Posted: 01 Feb 2019 08:44
by Filehero
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

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

Posted: 10 Feb 2019 17:19
by admin
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.

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

Posted: 10 Feb 2019 18:21
by Filehero
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.

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

Posted: 10 Feb 2019 18:23
by admin
Whoops, did not read close enough. I'll check that...

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

Posted: 11 Feb 2019 15:36
by admin
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...

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

Posted: 11 Feb 2019 16:49
by admin
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. :|

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

Posted: 11 Feb 2019 17:57
by Filehero
Hi Don,

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

FH

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

Posted: 11 Feb 2019 19:19
by admin
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...

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

Posted: 11 Feb 2019 23:01
by Filehero
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.

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

Posted: 12 Feb 2019 07:25
by admin
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.

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

Posted: 12 Feb 2019 09:12
by Filehero
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 277 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.

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

Posted: 12 Feb 2019 09:18
by admin
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. :|

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

Posted: 12 Feb 2019 09:56
by Filehero
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. :)