FileAge

Title FileAge
File Name FileAge.txt
Description Find "age" of files
Author Vochomurka
Parameters ("%L")
Plugins Called file, date, int64
Icon
Version 2.0
Updated on 28.08.2008
local fh = file.open(arg(1), "r")
local Str, i, Modif, Result, Mess, Unit, Num
local Secs = "31557600 2592000 86400 3600 60"
local Titles = "year month day hour minute"
local Now = date.now

if(fh > 0) do
	for(not(file.eof(fh))) 
		Str = file.readstring(fh)
		if(Str) do
			Mess = Mess ++ Str ++ ": " ++ esc(?+\t+, ?+\+)
			Modif = file.lastmodified(Str)
			Result = date.subseconds(Now, Modif)
			for(i = 1; i <= 5; i++)
				Num = word(Secs, i)
				Unit = int64.divide(Result, Num)
				if(Unit) do
					Mess = Mess ++ Unit ++ " " ++ word(Titles, i) ++ "s, "
					Result = int64.mod(Result, Unit*Num)
				else
					Result = int64.mod(Result, Num)
				endif
			endfor
			Mess = Mess ++ Result ++ " seconds" ++ esc(?+\n+, ?+\+)
		endif
	endfor
else
	messagebox("ok error", "File not opened", "FILE plugin error")
	quit
endif

file.close(fh)
messagebox("ok information", Mess, "FileAge Script")

Comments:

Script allows to find out how old the files are. Select files of interest (or point a single file) and run the script. You'll see something like:


Main Page Total Commander PowerPro