Is there a way to “touch” a file with a time stamp of my own choosing,
in other words, not the “now” time? I’ve got a bunch of files that have
been inadvertently “touched” time-wise, and I need them to have truer
time stamps, from a month or so ago.
Is there a way to “touch” a file with a time stamp of my own choosing,
in other words, not the “now” time? I’ve got a bunch of files that have
been inadvertently “touched” time-wise, and I need them to have truer
time stamps, from a month or so ago.
Is there a way to “touch” a file with a time stamp of my own choosing,
in other words, not the “now” time? I’ve got a bunch of files that have
been inadvertently “touched” time-wise, and I need them to have truer
time stamps, from a month or so ago.
Thanks. But, this is what I get when I try that. Doesn’t the “Time.now”
give it the time of right now?
irb(main):003:0> FileUtils.touch(file, :mtime => Time.now)
ArgumentError: no such option: mtime
from c:/ruby/lib/ruby/1.8/FileUtils.rb:1424:in fu_check_options' from c:/ruby/lib/ruby/1.8/FileUtils.rb:1009:intouch’
from (irb):3
Thanks, Robert. That particular thing just doesn’t work for me, but, I’m
intrigued by File.utime. I read about it a bit and I think it might do
the trick. Thanks a lot!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.