Are two files identical : identical « File Directory « Ruby






Are two files identical


File.identical?("ruby", "ruby")          # => true if the file exists
File.identical?("ruby", "/usr/bin/ruby") # => true if CWD is /usr/bin
File.identical?("ruby", "../bin/ruby")   # => true if CWD is /usr/bin
File.identical?("ruby", "ruby1.9")       # => true if there is a link

 








Related examples in the same category

1.Checking whether two files are identical is easy