2件ヒット
[1-2件を表示]
(0.246秒)
検索結果
-
Dir
. exist?(file _ name) -> bool (78337.0) -
file_name で与えられたディレクトリが存在する場合に真を返します。 そうでない場合は、偽を返します。
file_name で与えられたディレクトリが存在する場合に真を返します。
そうでない場合は、偽を返します。
@param file_name 存在を確認したいディレクトリ名。
//emlist[例][ruby]{
Dir.exist?(".") # => true
File.directory?(".") # => true
//}
@see File.directory? -
FileTest
. # exist?(file) -> bool (78337.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...