f1 = File.new("f1", "w") sleep 1 f2 = File.new("f2", "w") f1.stat <=> f2.stat # Methods in Comparable are also available f1.stat > f2.stat # false f1.stat < f2.stat # true