From: Brian Candler Date: 2009-11-02T19:48:52+09:00 Subject: Re: mtime.max Derek Smith wrote: > My goal is to get the oldest file using mtime.to_i then delete it. How about: stats = DB_BKUP1.map { |dbfile| [dbfile, File.stat(dbfile)] } stats = stats.sort_by { |dbfile,stat| stat.mtime } puts "Please rm #{stats.first[0]}" -- Posted via http://www.ruby-forum.com/.