るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.025秒)
トップページ > クエリ:IO[x] > バージョン:2.3.0[x] > クエリ:directory?[x] > モジュール:FileTest[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io readlines
  4. io each
  5. io each_line

ライブラリ

検索結果

FileTest.#directory?(file) -> bool (54340.0)

ファイルがディレクトリの時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ブジェクト file が既に close されていた場合に発生します。

例:
FileTest
.directory?('/etc') # => true
FileTest
.directory?('/etc/passwd') # => false

f = File.open('/etc')
FileTest
.directory?(f) # => true
f.close
FileTest
.directory?(f) # => IOError: closed stream...