Created
April 6, 2013 03:20
-
-
Save chikadance/5324595 to your computer and use it in GitHub Desktop.
Get lastest filename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Tool | |
def get_lastest() | |
Dir.glob("**/**/*.rb") do |filename| | |
puts "filename: #{filename},atime:#{File.stat(filename).atime}" | |
end | |
# get filename with most access time ##!! use min, but max | |
Dir.glob("**/**/*.rb").sort { |a, b| File.stat(a).atime <=> File.stat(b).atime }.min | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment