# List the file that was updated the last
lst_fl = Dir.glob("/home/developer/myFiles/*")
files_updated_last = Dir["/home/developer/myFiles/*"]
Dir.glob(File.join("/home/developer/myFiles/", '*.rb')).each do |lst_fl|
files_updated_last.sort_by{|lst_fl| File.mtime(lst_fl)}
end
puts files_updated_last
上記は私のルビーコードです。最後に変更された時間に応じてファイルを並べ替えて一覧表示したい。これを達成する方法を教えてください。このコードでは、単にファイルのリストを取得していますが、最終変更時刻の順序付けられた方法ではありません。
最終変更時刻ごとのファイルリストが必要です