Mega Code Archive

 
Categories / Ruby / File Directory
 

Finds all files that havent been accessed since they were last modified

require 'find' module Find   def match(*paths)     matched = []     find(*paths) { |path| matched << path if yield path }     return matched   end   module_function :match end def possibly_abandoned(*paths)   Find.match(*paths) { |p| f = File.lstat(p); f.mtime == f.atime } end