Ruby Programming/Reference/Objects/IO/File/File::Stat
From Wikibooks, the open-content textbooks collection
< Ruby Programming | Reference | Objects
First create a file, and then call the stat method on it. Use the methods of stat to obtain information about the file.
Example:
if File.new('/etc').stat.directory?
puts '/etc is a directory'
end