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/.