るりまサーチ

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

別のキーワード

  1. option bool
  2. socket bool
  3. variant vt_bool
  4. win32ole vt_bool
  5. bool socket

ライブラリ

検索結果

FileTest.#directory?(file) -> bool (18202.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...