Ruby 1.9.3 Reference Manual > All Libraries > Builtin Library > class File::Stat > ftype
ftype -> Stringファイルのタイプを表す文字列を返します。文字列は以下のうちの いずれかです。
"file" "directory" "characterSpecial" "blockSpecial" "fifo" "link" "socket" "unknown"
サンプル
fs = File::Stat.new($0) p fs.ftype #=> "file" p File::Stat.new($:[0]).ftype #=> "directory"