Ruby/File Directory/stat

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

Compares File::Stat objects by comparing their respective modification times.

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