M
Matt Spendlove
Hi list
I am learning some core Ruby (non Rails env) by playing with some File
i/o stuff and running under JRuby
1) How do I utime a Dir? - Dir doesn't seem to have the method and
passing a dir to File.utime seems to just get ignored.
2) My script needs to compare the mtime of a file with a constant
offset. I ended up with this ugliness, turning both into Dates because
I couldn't figure out how to turn a TWO_WEEKS_AGO into a Time! :
====================================
TWO_WEEKS_AGO = Date.today - 14
if Date.parse(File.stat(path).mtime.to_s) > TWO_WEEKS_AGO
I am learning some core Ruby (non Rails env) by playing with some File
i/o stuff and running under JRuby
1) How do I utime a Dir? - Dir doesn't seem to have the method and
passing a dir to File.utime seems to just get ignored.
2) My script needs to compare the mtime of a file with a constant
offset. I ended up with this ugliness, turning both into Dates because
I couldn't figure out how to turn a TWO_WEEKS_AGO into a Time! :
====================================
TWO_WEEKS_AGO = Date.today - 14
if Date.parse(File.stat(path).mtime.to_s) > TWO_WEEKS_AGO