#!/usr/bin/ruby # Class for getting last update time of files etc. # # Written by k-fleak # class FileStat def initialize(filenameIn) @filename = filenameIn end def getLastUpdate month = File::stat(@filename).mtime.mon.to_s day = File::stat(@filename).mtime.day.to_s hour = File::stat(@filename).mtime.hour.to_s min = File::stat(@filename).mtime.min.to_s year = File::stat(@filename).mtime.year.to_s if month.size == 1 then month = " " + month end if day.size == 1 then day = "0" + day end if hour.size == 1 then hour = "0" + hour end if min.size == 1 then min = "0" + min end @lastUpdate = month + "/" + day + " " + hour + ":" + min + " " + year return @lastUpdate end end