るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.083秒)
トップページ > クエリ:Kernel.#p[x] > クエリ:$PREMATCH[x] > クエリ:exec[x] > クエリ:y[x] > モジュール:FileTest[x]

別のキーワード

  1. kernel $process_id
  2. kernel $program_name
  3. kernel $kcode
  4. kernel $match
  5. kernel $prematch

ライブラリ

検索結果

FileTest.#identical?(file1, file2) -> bool (37.0)

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

...

ruby 1.8.3 以前ではKernel.#test(?-, file1, file2)を使ってください。

open("a", "w") {}
p
File.identical?("a", "a") #=> true
p
File.identical?("a", "./a") #=> true
File.link("a", "b")
p
File.identical?("a", "b") #=> true
File.symlink("a", "c")
p
File.ident...
...ical?("a", "c") #=> true
open("d", "w") {}
p
File.identical?("a", "d") #=> false

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

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

@raise IOError...