Khronos: A Plugin for Ageing Gracefully

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Khronos: A Plugin for Ageing Gracefully

Post by Kilmatead »

So, here we are again, indulging one of my many obsessional fortés: Timestamps. :wink: If you are like most people and don't care about having accurate timestamps on your folders then this is perhaps not the toy for you. :shrug: On the other hand, since you're using a professional file-manager in the first place and from time to time have secretly considered yourself a bit of a power-user, then you might find my efforts amusing (or worse, :shock: even useful).

What is this thing?

In the beginning there was Modifiche, a script which simply took a folder structure (of any depth) and corrected the modification dates of all folders/subfolders according to their contents, not settling for the somewhat arbitrary (that is to say, flawed) state in which Windows always left them.

The trouble with such a script (no matter how thorough the design) is that it could only work when it was actually applied - after the user had meddled and mucked with the contents of his folders for a few days, it was more than likely that all the dates were flummoxed again, and so required re-applying the script to correct them. Unsurprisingly, anoraks, power-users, and anyone else with a piquant touch of OCD in their personalities (you know who you are) dislike that kind of unreliable existence: we know, at a gut-level, that it's just not right.

Thus, enter Khronos, a plugin which corrects folder timestamps in the background as you browse (in a hardware-scalable manner) and shows a customisable display of objects' Ages.

Image

Image

Image

How do I install this thing?

This is a WDX "Content" Plugin (supported as of version 3.1 of xplorer2 Pro/Ult), all you need to do is download (if you don't already have it) the x2 Plugin Manager (no installation required), and, of course, the plugin itself: Khronos v0.0.2.5.

Extract the archive and run the plugin manager, then drag-&-drop either the 64-bit (Khronos.WDX64) or 32-bit (Khronos.WDX) plugin into the window and click "Apply". Ignore the KhronosUI.exe programme for now, that's ancillary and not technically required.

Once x2 has restarted, use <Alt+K> to enter the column selection dialog, and scroll all the way to the bottom of the available columns list - there you'll find an extra entry named "Age.Khronos [X]" - just double-click it and you're done.

How do I get to those nifty option-screens of yours?

Two ways - the plugin provides its own customisable hot-key (just press <Ctrl+Alt+K> at any time), or if you prefer a toolbar button (or just don't like hotkeys), you can click on the KhronosUI file and that will do it. Though the options are all stored in an INI (plus a few not directly available in the UI itself), it's not recommended to edit that file directly unless you read the remarks in the (included) source-code first.

How does this thing work? And why are all those options so scary-looking? And what does 'Hardware Scaling' really mean?

I have been accused in the past by certain Gothic members of this forum for "spending too much time thinking about formalities" in my retro-GUI designs, and since I have no idea what that actually means :D, I'll avoid fancy words like 'anti-skeuomorphism', and just say I enjoy a certain technical reference with my cognac of an evening. Bringing over-engineered projects to the public sometimes requires the public to up-their-game a bit. :wink:

That aside, while any vaguely bright 4-year-old child could write an algorithm to homogenise the timestamps of folders to their contents, the next step in the equation is to ask yourself what the most efficient method of implementing this workload may actually be, given modern computer hardware and (especially) the advent of SSD's.

Say you browse to the root of your C:\ drive. The normal stuff there is of course the Users folder, the Programmes folder, the Windows folder, etc. As you can imagine, for this plugin to scan each of these folders (and all of their subfolders) comparing zillions of timestamps it can take quite awhile the larger the folder structure is. So, instead of waiting for each folder to be processed sequentially, each one is allocated its own thread, so the Users folder gets one thread, the Programmes folder a second thread, and so on, and these threads all run at the same time in the background so the columns populate much faster overall, rather than waiting for one large folder to finish before processing subsequent smaller (and thus faster) structures.

Now, you're probably saying to yourself "But that's madness! The poor disc-drive will have a heart attack trying to access all those timestamps at the same bloody time!"

And you'd be right - up to a point. A hard-disc's speed is directly proportional to its random-access IOPS (Input/Output/Per/Second), and the throughput is determined accordingly, but data is accessed in differently sized increments depending on the requested operation types. To be more explicit, if you ever wondered why SSD's are so much faster than mechanical drives, it's because their IOPS are usually in the range of about 100,000 while an older "spinning-rust" (mechanical) drive will average around 170 at best. Yes, that's 170 vs. 100,000. (NVMe drives can easily reach 300,000 to 400,000 these days, but that's just icing on the cake from a practical viewpoint - normal SATA-III SSD's are common-place enough to satisfy most workloads.) As such, SSD's can operate non-sequentially, where thousands of these asynchronous requests can be processed in parallel resulting in very little latency. That's a fancy way of saying serial (single-threaded) processing is for dweebs, whereas parallel (multi-threaded) is for the cool kids. :D

But what if you don't have an SSD, or work with a variety of drives? Or have only 2 or 4 cores in your CPU instead of 8? Well, that's where all the options come in... this plugin can be tailored from the simplest of setups to the more advanced, with the user being able to tweak things to whatever level they think is most efficient for them (only process some folders but not others, some drives but not others, etc, etc). Or, you can just ignore all the options, set it to "Basic" and live in a serial world. It's up to you.

This aspect of the plugin (the correction of timestamps) may also be disabled completely, though in that case the column display "Age" will only be accurate for files, and not folders, since it only takes what it's given. :shrug:

Be aware that the modification of timestamps is (of course) linked to folder-permissions so non-admin UAC users will be hamstrung on much of their C: drive (Program Files, etc), and so may wish to "Exclude" those locations to save spurious processing. Though any assignment-failures won't impact their ability to browse anywhere they like (failures can be ignored), it does render the end-result somewhat moot.

A bit of history...

Anyone familiar with Total-Commander Plugins will notice that there's a pre-existing one called Tempus which I myself used for about a year before I decided to write my own. Tempus is an excellent plugin, though I grew frustrated with the inflexible (single-threaded) serial nature of the approach, and found the INI-only method of adjusting options to be somewhat confusing and rather difficult for first-time users to configure properly. It also doesn't provide any means for the user to judge exactly what it's doing, what's been changed, or (potentially) what it failed to change. Also, some of Tempus' design is not directly applicable to x2's plugin-milieu, so understanding what options are or are not available (or even work) may be difficult to grok without knowing the plugin API under x2.

That's why I decided to write my own, replete with built-in GUI (which doesn't require x2 to be restarted just to apply new settings), an easily localised Age column, and an Event-Log which can track everything you never cared about but may think is "nice to know it's there" anyway. :D

And finally...

I would like to thank the user Tuxman for his beta-testing, patience, suggestions, and feedback. Though I ignored most of his complaints (hey, what can I say?), it's the thought that counts, and I appreciate it.

I would like to not thank the user pj for his apparent inability to upgrade x2, beta-test, or stick to giving feedback on the subject at hand. :biggrin: One hopes he puts more diligence into the space-satellite industry than he does our more menial Earth-bound considerations, else large metal objects may start falling on all our heads, and not just his.

And though the hammock-bound and irascibly rum-soaked user dunno played no part in testing, and may have absolutely no personal use for this toy whatsoever, I would like to thank him for inspiring much of the (threading) work that went into it. With every project I do, I like to learn something new, and this time that's true in spades. May all our ranting prove as accidentally inspirational to forum-lurkers everywhere.
Last edited by Kilmatead on 2017 Oct 05, 11:27, edited 3 times in total.
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Re: Khronos: A Plugin for Aging Gracefully

Post by dunno »

Damn I'm late to this party.

A honourable mention, I'm famous :-)
I installed without issues, the writing on the tin is clear and concise, "stand in boiling water for 10 minutes", scalded my legs bright red :-))
Great gizmo, my OCD can retire to it's hammock for a while.

Thanks for your effort, when is Mr. Nikos going to incorporate this ?.
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Aging Gracefully

Post by Kilmatead »

dunno wrote:Damn I'm late to this party.
It's a chicken and the egg thing - what's really going to bake your noodle later on is would you have actually tried/installed it had you not gotten an honourable mention in the first place? :wink:
dunno wrote:...when is Mr. Nikos going to incorporate this?
It's too niche a concept to tickle his conservatism - we live in a world where the "expectation of accuracy" can be dismissed as a mere gimmick (every dog and his collar has GPS tracking), so to be mainstream you have to appeal to the mainstream, and that ain't me. Besides, for the same reason other file-managers don't - it's excessively resource-hungry (unless great effort is put into mitigating/hiding that), and anyway, by allowing plugins in the first place, from his point of view, "he already has". :D

Like any good mogul, he lets others do the work and then sits back and takes all the credit. I keep telling him to read up on the lessons to be learnt from the French Revolution, but as is the case with all aristocracy, they never believe it will happen to them. :twisted:
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: Khronos: A Plugin for Aging Gracefully

Post by Tuxman »

Wait, your UIs are actually designed?
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Aging Gracefully

Post by Kilmatead »

'Designed' is such a strong word for it... nothing so grand as the back of a napkin... more, how might you put it... "Essen, bei dem jeder etwas mitbringt"? If an option wishes to join with its brethren and can offer something to the user, it will find bedding in some odd corner of the room. If not, well, many's the checkbox that's lost its job to a younger, sexier, radio-button. Or, at least, that's how the checkbox tells it. :wink:
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: Khronos: A Plugin for Aging Gracefully

Post by Tuxman »

I can see why you dislike radio buttons. A friendly narrative would tell that "either / or" is not preferable to "and", the other narrative would revolve around the fact that coding radio buttons is more effort because they need to be linked to each other. :)
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Aging Gracefully

Post by Kilmatead »

Plus, checkboxes have the possibility of BS_3STATE which can be used to great effect just in case someone really wanted to mess with the user's brain. Gives the sin of indecision a whole new and terrible reason to drown its sorrows.
pj
Gold Member
Gold Member
Posts: 471
Joined: 2006 Jan 26, 14:01
Location: Florida

Re: Khronos: A Plugin for Ageing Gracefully

Post by pj »

Kilmatead wrote: 2017 Mar 18, 15:03 I would like to not thank the user pj for his apparent inability to upgrade x2, beta-test, or stick to giving feedback on the subject at hand. :biggrin: One hopes he puts more diligence into the space-satellite industry than he does our more menial Earth-bound considerations, else large metal objects may start falling on all our heads, and not just his.
So nice to be wanted!

By the way, how's the progress on the suggestions I made for TT?

--------------------------------------
PJ in (warm, sunny) FL
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Ageing Gracefully

Post by Kilmatead »

pj wrote:By the way, how's the progress on the suggestions I made for TT?
Obviously the subtleties behind "stick to giving feedback on the subject at hand" are too-curious anomalies for rocket-scientists... :wink:

Your generous TT-related cheques-of-remuneration must have gone missing in the mail again...

<Throws arms up in the air in appeal to the Gods of Exasperation>
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Re: Khronos: A Plugin for Ageing Gracefully

Post by dunno »

Dear Mr. K.
I really like this method of displaying time elapsed, but....there's always a butt...

Would it be possible to align the display of the appended descriptor so that the display of hours, days, weeks, years, centuries are all neatly aligned below each other and not staggered, PLEASE :bigsmile:
like this (difficult to demo 'cause spaces are removed by something here).
Days
Weeks
Months
Years
Centuries

*returns to hammock for more sundowner*
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Ageing Gracefully

Post by Kilmatead »

dunno wrote:Would it be possible to align the display of the appended descriptor ... all neatly aligned below each other and not staggered
If you mean right-justified instead of left-justified, then no, plugins have no control over the disposition of their column LVCFMT alignments (Left, Right, Centred). Those are handled within x2 itself as it creates the columns in the listview, and it seems to default to left-only.

(And, before you ask, no, column-field-text does not respond to embedded <Tab> characters or formatting methods other than the insertion of multiple spaces; within variable-width fonts, trying to "fudge" alignments using space characters is nigh on impossible and almost always ends in tears and the terrible sound of gnashing teeth, accompanied by some most flowery language where the walls themselves have been known to blush a bright crimson before crumbling into a calm pile of meek dust while the assembled villagers weep a soulful dirge of lament afore the dusking sunset [all dancing absurdly to the Bee Gee's "Tragedy"].)

If the above is not what you were referring to, then you'll have to mock-up a better example as my imagination has run out of alternatives. :wink: (Unless you're talking about sorting the column, which is also not really possible, though sorting by modification date will accomplish the same thing.)

But the short answer is, most likely, going to be "No". Sorry about that.
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Re: Khronos: A Plugin for Ageing Gracefully

Post by dunno »

Yes I was referring to column field text, thanks for clearing that up much appreciated.

I'm now trying to purge the image of village people dancing to "Tragedy" from my mind, "Young Man" you've ruined that song.
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Ageing Gracefully

Post by Kilmatead »

No stranger than the Bee Gees dancing to the Village People's YMCA, really. What else is time for, but to mish-mash our memories into a hazy musical whole? :D
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: Khronos: A Plugin for Ageing Gracefully

Post by Tuxman »

It's time for ha, ha, ha, ha, staying alive, staying alive. :party:
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
dunno
Gold Member
Gold Member
Posts: 506
Joined: 2007 Nov 18, 03:00
Location: Tropical Hammock

Re: Khronos: A Plugin for Ageing Gracefully

Post by dunno »

I clicked Age Khronos header to sort the ages, got shredded to bits
Post Reply