I am trying to extract an exact filename so that I can use mtime method.
It appears to be needing an exact filename and maybe I am getting other
artifacts when iterating through this directory. Would you know how to
fix? Please help me with this. Thanks. MC
Dir.entries(“C:/New”).each do |filename|
if File.extname(filename) == “.txt” then
puts File.mtime(filename) #<–gets error ‘No such file or directory’
puts File.mtime(“C:/New/2343434.txt”)#<–works by outputting modified