<UTIL>Redate whole dir-trees folders to youngest file

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

Moderators: sheep, Hacker, Stefan2, white

User avatar
Usher
Power Member
Power Member
Posts: 644
Joined: 2011-03-11, 10:11 UTC

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Usher » 2019-08-23, 22:34 UTC

2tbeu

There's a problem in Windows XP, when dealing with any folder containing index.dat file. Using setfolderdate plugin for such folders always ends with error message like below:

Code: Select all

C:\Documents and Settings\User\Local settings\Temporary Internet Files\Content.IE5\index.dat
---------------------------
Failed to get last write time.
As index.dat files are used by Internet Explorer, it's possible that the same error message will show in Windows Vista and Windows 7 using IE8. IE11 in Windows 7 and newer systems doesn't use those files and there's no such a problem with setfolderdate.
Regards from Poland
Andrzej P. Wozniak

mikedepetris
Junior Member
Junior Member
Posts: 63
Joined: 2006-11-07, 16:36 UTC
Location: Trieste, Italy
Contact:

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *mikedepetris » 2019-08-24, 06:33 UTC

Usher wrote:
2019-08-23, 22:34 UTC
2tbeu

There's a problem in Windows XP, when dealing with any folder containing index.dat file. Using setfolderdate plugin for such folders always ends with error message like below:

Code: Select all

C:\Documents and Settings\User\Local settings\Temporary Internet Files\Content.IE5\index.dat
---------------------------
Failed to get last write time.
As index.dat files are used by Internet Explorer, it's possible that the same error message will show in Windows Vista and Windows 7 using IE8. IE11 in Windows 7 and newer systems doesn't use those files and there's no such a problem with setfolderdate.
Even when you run TC as Administrator?

User avatar
tbeu
Power Member
Power Member
Posts: 1269
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *tbeu » 2019-08-24, 12:30 UTC

Usher wrote:
2019-08-23, 22:34 UTC
2tbeu

There's a problem in Windows XP, when dealing with any folder containing index.dat file. Using setfolderdate plugin for such folders always ends with error message like below:

Code: Select all

C:\Documents and Settings\User\Local settings\Temporary Internet Files\Content.IE5\index.dat
---------------------------
Failed to get last write time.
As index.dat files are used by Internet Explorer, it's possible that the same error message will show in Windows Vista and Windows 7 using IE8. IE11 in Windows 7 and newer systems doesn't use those files and there's no such a problem with setfolderdate.
I already try to retrieve the last write time using two different API calls, see https://gitlab.com/tbeu/wcx_setfolderdate/blob/e09dad025666cb4ea7a1872efdf571051c73e596/src/wcx_setfolderdate.cpp#L59-75. I have no chance to reproduce and also no good idea what I could improve here.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more

User avatar
Usher
Power Member
Power Member
Posts: 644
Joined: 2011-03-11, 10:11 UTC

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Usher » 2019-08-24, 15:08 UTC

mikedepetris wrote:
2019-08-24, 06:33 UTC
Usher wrote:
2019-08-23, 22:34 UTC
2tbeu
There's a problem in Windows XP,
Even when you run TC as Administrator?
I am a user with Administrator rights in Windows XP. There's no UAC here, and it doesn't matter. I have no access to my own NTUSER.DAT and ntuser.dat.LOG content in TC (both open and locked by OS), but I can see their attributes (including timestamps) in directory listing. And I can browse index.dat files and even change their timestamps using TC. The files are just always open and used by the system (Explorer/shell and other apps using Explorer/IE libs) - you can't delete them.

@tbeu
You don't need to open any file to read its attributes from MFT/FAT table.
Regards from Poland
Andrzej P. Wozniak

User avatar
Horst.Epp
Power Member
Power Member
Posts: 3485
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Horst.Epp » 2019-08-24, 15:31 UTC

I think using a util like FolderTimeUpdate from Nirsoft would be the better way
to make this job and it contains all settings one may search for.
https://www.nirsoft.net/utils/folder_time_update.html
Windows 10 Home x64 November 2019 Update, Version 1909 (OS Build 18363.535)
Intel(R) Core(TM) i7-4770 CPU @ 3.40GH, 16GB RAM
TC 9.50ß9 x64 / x86, Everything 1.4.1.960 (x64)

User avatar
tbeu
Power Member
Power Member
Posts: 1269
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *tbeu » 2019-08-24, 18:29 UTC

Usher wrote:
2019-08-24, 15:08 UTC
@tbeu
You don't need to open any file to read its attributes from MFT/FAT table.
Reading MSDN: First parameter of GetFileTime is the file handle which must have been created using the CreateFile function with the GENERIC_READ access right.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more

User avatar
Dalai
Power Member
Power Member
Posts: 6782
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Dalai » 2019-08-24, 19:01 UTC

2tbeu
Maybe FindFirstFile is better in such a case? WIN32_FINDDATA structure contains all three file times, too.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups

User avatar
tbeu
Power Member
Power Member
Posts: 1269
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *tbeu » 2019-08-24, 20:37 UTC

Dalai wrote:
2019-08-24, 19:01 UTC
2tbeu
Maybe FindFirstFile is better in such a case? WIN32_FINDDATA structure contains all three file times, too.

Regards
Dalai
Good point. Please try SetFolderDate version 1.2.0.0.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more

User avatar
Usher
Power Member
Power Member
Posts: 644
Joined: 2011-03-11, 10:11 UTC

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Usher » 2019-08-24, 23:41 UTC

2tbeu
Now it works OK and seems to be faster. Just one little thing - could you use shorter "extension" - setDIRdate or DIRdate? TC uses <DIR> name…
Regards from Poland
Andrzej P. Wozniak

User avatar
tbeu
Power Member
Power Member
Posts: 1269
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *tbeu » 2019-08-25, 17:54 UTC

@Usher
Thanks for confirmation. Will fix the default "extension" with the next update.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more

User avatar
Usher
Power Member
Power Member
Posts: 644
Joined: 2011-03-11, 10:11 UTC

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Usher » 2019-10-21, 23:48 UTC

2tbeu
You should change icon for Redate. It's invisible in dark mode.
Regards from Poland
Andrzej P. Wozniak

User avatar
tbeu
Power Member
Power Member
Posts: 1269
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *tbeu » 2019-10-25, 12:53 UTC

Which icon actually?
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more

User avatar
Usher
Power Member
Power Member
Posts: 644
Joined: 2011-03-11, 10:11 UTC

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Usher » 2019-10-25, 13:10 UTC

Of course the default one, added to buttonbar. Currently it's a "Redate" text, black on a transparent background, with no light border around letters.
Regards from Poland
Andrzej P. Wozniak

User avatar
tbeu
Power Member
Power Member
Posts: 1269
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *tbeu » 2019-10-28, 08:34 UTC

There is no icon in SetFolderDate.wcx.
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more

User avatar
Usher
Power Member
Power Member
Posts: 644
Joined: 2011-03-11, 10:11 UTC

Re: <UTIL>Redate whole dir-trees folders to youngest file

Post by *Usher » 2019-10-28, 11:32 UTC

2tbeu
I mean Redate util (addon, exe) as in the topic title, not your SetFolderDate plugin. Sorry for wrong addressing.

@moderators: Could you change titles in this topic, please? It's NOT about Redate util so it's misleading. "Change date of" or "Change timestamp of" will be better.
Regards from Poland
Andrzej P. Wozniak

Post Reply