First off, I will precede this by saying I, myself, don't greatly need this at the present moment; I have a mostly acceptable "alternative" that, unfortunately is only available to me (more on that at the bottom of this e-mail). But what I would like is a function (similar to the existing "@FileAge" function except that it would return the file's age in a human-readable format that the existing "@FileAge" function does not do; I’ve (at least “mostly”) “figured out" what a file’s ”age” “consists” of, but that’s not too useful) that returns a file's age in the general format "[yy years ][mm months ][dd days ][hh:mm:ss[.fff]]" such as "12 years 5 months 21 days 10 hours 21 minutes 30.123 seconds" where each of the "fields" is omitted if zero (i.e.," 5 months 3 hours", as a rather-unlikely example). There are many times where I really want to know how “old” a file is, and I do not, at least, know of any other way to do that.
Now, as I believe I’ve mentioned in the past, I’ve got a (C++) program I wrote many years ago named “DCalc” (for “Decimal Calculator”), but given the range of capabilities that that program now has, that name is really not all that “descriptive” any more. As just one example, the program will do date/time arithmetic with very few “limitations”, and the “output” of said program is generally acceptable in most situations, but not in all situations. For example, if I type in the “command” “HowOld ASampleFile.txt” a, I might get something back like “6 days, 16:30:59”. However, it would be nice if the report was in the format “6 days 16 hours 30 minutes and 59 seconds”, but, even more importantly, if I enter the command “HowOld ARatherOldFile.txt”, I “get back” something like “6979 days 13:02:04”, which is really only “partially” acceptable because “6979” days is not too meaningful to anybody.
So, just for the record, here is the “Alias” command I used to "create" the “HowOld” command:
I’m not going to take the time to “parse” that in any great detail, but it really isn’t all that complicated.
Now, as I believe I’ve mentioned in the past, I’ve got a (C++) program I wrote many years ago named “DCalc” (for “Decimal Calculator”), but given the range of capabilities that that program now has, that name is really not all that “descriptive” any more. As just one example, the program will do date/time arithmetic with very few “limitations”, and the “output” of said program is generally acceptable in most situations, but not in all situations. For example, if I type in the “command” “HowOld ASampleFile.txt” a, I might get something back like “6 days, 16:30:59”. However, it would be nice if the report was in the format “6 days 16 hours 30 minutes and 59 seconds”, but, even more importantly, if I enter the command “HowOld ARatherOldFile.txt”, I “get back” something like “6979 days 13:02:04”, which is really only “partially” acceptable because “6979” days is not too meaningful to anybody.
So, just for the record, here is the “Alias” command I used to "create" the “HowOld” command:
Code:
Alias HowOld=`DCalc /B Now()-(%@Left[6,%@FileDate[%1,%1]]%@If[%@Right[2,%@File
Date[%1,%2]] LT 20,20,19]%@Right[2,%@FileDate[%1,%2]]+%@FileTime[%1,%2])