Module | FileTest |
In: |
file.c
|
FileTest implements file test operations similar to those used in File::Stat. It exists as a standalone module, and its methods are also insinuated into the File class. (Note that this is not done by inclusion: the interpreter cheats).
Returns true if the named file exists and the effective group id of the calling process is the owner of the file. Returns false on Windows.
Returns true if the named files are identical.
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.identical?("a", "c") #=> true open("d", "w") {} p File.identical?("a", "d") #=> false
Returns true if the named file exists and the effective used id of the calling process is the owner of the file.