[WCX] SetFolderDate 1.3.0.0

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

Moderators: white, Hacker, petermad, Stefan2

User avatar
versalzen
Power Member
Power Member
Posts: 666
Joined: 2003-09-16, 11:52 UTC
Location: kölle, linksrheinisch.

Re: [WCX] SetFolderDate

Post by *versalzen »

Hey,

It seems, the dates written to directories are takes from their sub-directories too, not only from the files inside those directories.
eitang wrote: 2012-12-16, 19:53 UTCEach directory will be timestamped to the same time and date of the youngest file inside it.
The quoted description does not mention that specificly.

Also, the current readme of the plugin mentiones only files.
Readme.txt wrote:SetFolderDate is a utility packer plugin for Total Commander to recursively set
the timestamp of directory structures from the last modified/write time of the
youngest file inside.
Can we have a switch to only consider files as sources for dates?

I've tested the Plugin with the root of the folderstructure from this plugin.
After executing, the folder \fonts\ in \GraphicConverter\rsvg\etc\ is dated 28.02.16, but the file fonts.conf inside \fonts\ is dated 30.12.17

Tested with both options youngest/oldest and not entirely sure, weather this is by intention or a bug or something else...
Was nützt der Löffel für die Weisheit, wenn man zu weit vom Suppentopf entfernt sitzt?

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

Re: [WCX] SetFolderDate

Post by *mikedepetris »

mikedepetris wrote: 2019-07-14, 06:37 UTC Did some more testing, let's talk about empty directories, what should we do with them? At the moment their timestamp stays untouched when it is the newest in the parent tree and this becomes the timestamp for all. Well in most case I would like to set the timestamp only to the most recent actual file in the tree, not directory. For me this would work always, don't know if it should be optional behavior as I see other tools let you choose what to do with empty dirs.
I still would like to have an option to set all empty folders dates to the joungest file in the containing folder, unless the timestamp is already older.
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: [WCX] SetFolderDate

Post by *tbeu »

versalzen wrote: 2019-08-20, 01:27 UTC Can we have a switch to only consider files as sources for dates?
Yes, should be possible.
versalzen wrote: 2019-08-20, 01:27 UTC I've tested the Plugin with the root of the folderstructure from this plugin.
After executing, the folder \fonts\ in \GraphicConverter\rsvg\etc\ is dated 28.02.16, but the file fonts.conf inside \fonts\ is dated 30.12.17
You obviously used the option "Ue oldest file" then.
mikedepetris wrote: 2019-08-20, 11:30 UTC I still would like to have an option to set all empty folders dates to the joungest file in the containing folder, unless the timestamp is already older.
Empty folders are leafs in the directory structure and are currently not touched.
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
mikedepetris
Junior Member
Junior Member
Posts: 84
Joined: 2006-11-07, 16:36 UTC
Location: Trieste, Italy
Contact:

Re: [WCX] SetFolderDate

Post by *mikedepetris »

tbeu wrote: 2019-08-20, 19:01 UTC
mikedepetris wrote: 2019-08-20, 11:30 UTC I still would like to have an option to set all empty folders dates to the joungest file in the containing folder, unless the timestamp is already older.
Empty folders are leafs in the directory structure and are currently not touched.
Yes I know, mine is a request =)
User avatar
versalzen
Power Member
Power Member
Posts: 666
Joined: 2003-09-16, 11:52 UTC
Location: kölle, linksrheinisch.

Re: [WCX] SetFolderDate

Post by *versalzen »

tbeu wrote: 2019-08-20, 19:01 UTC
versalzen wrote: 2019-08-20, 01:27 UTC I've tested the Plugin with the root of the folderstructure from this plugin.
After executing, the folder \fonts\ in \GraphicConverter\rsvg\etc\ is dated 28.02.16, but the file fonts.conf inside \fonts\ is dated 30.12.17
You obviously used the option "Ue oldest file" then.
Yes, I used "oldest file".

My very personal logic tells me:
There is only 1 file in that \fonts\ directory, so there is no oldest or newest date. its just 1 date which should and can be used, IMHO.

So with this additional option:
tbeu wrote: 2019-08-20, 19:01 UTC
versalzen wrote: 2019-08-20, 01:27 UTC Can we have a switch to only consider files as sources for dates?
Yes, should be possible.
The date would be 30.12.17 instead of 28.02.16 ?
Was nützt der Löffel für die Weisheit, wenn man zu weit vom Suppentopf entfernt sitzt?

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

Re: [WCX] SetFolderDate

Post by *Usher »

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.
Andrzej P. Wozniak
Polish subforum moderator
mikedepetris
Junior Member
Junior Member
Posts: 84
Joined: 2006-11-07, 16:36 UTC
Location: Trieste, Italy
Contact:

Re: [WCX] SetFolderDate

Post by *mikedepetris »

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: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: [WCX] SetFolderDate

Post by *tbeu »

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: 1675
Joined: 2011-03-11, 10:11 UTC

Re: [WCX] SetFolderDate

Post by *Usher »

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.
Andrzej P. Wozniak
Polish subforum moderator
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [WCX] SetFolderDate

Post by *Horst.Epp »

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 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: [WCX] SetFolderDate

Post by *tbeu »

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: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: [WCX] SetFolderDate

Post by *Dalai »

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, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: [WCX] SetFolderDate

Post by *tbeu »

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: 1675
Joined: 2011-03-11, 10:11 UTC

Re: [WCX] SetFolderDate

Post by *Usher »

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…
Andrzej P. Wozniak
Polish subforum moderator
User avatar
tbeu
Power Member
Power Member
Posts: 1336
Joined: 2003-07-04, 07:52 UTC
Location: Germany
Contact:

Re: [WCX] SetFolderDate

Post by *tbeu »

@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
Post Reply