るりまサーチ (Ruby 2.6.0)

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file path
  4. file umask
  5. file ctime

ライブラリ

検索結果

FileTest.#exist?(file) -> bool (63697.0)

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

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

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