るりまサーチ (Ruby 2.6.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.069秒)

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

クラス

モジュール

検索結果

Dir.exist?(file_name) -> bool (78307.0)

file_name で与えられたディレクトリが存在する場合に真を返します。 そうでない場合は、偽を返します。

file_name で与えられたディレクトリが存在する場合に真を返します。
そうでない場合は、偽を返します。

@param file_name 存在を確認したいディレクトリ名。

//emlist[例][ruby]{
Dir.exist?(".") # => true
File.directory?(".") # => true
//}

@see File.directory?

File.exist?(path) -> bool (78307.0)

FileTest.#exist? と同じです。

FileTest.#exist? と同じです。

@param path パスを表す文字列か IO オブジェクトを指定します。

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

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

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

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

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

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