检查两个文件是否具有相同的内容

Mel*_*bel 5 ruby file

我想检查几千对文件中的每一对是否包含相同的信息.有人能指出我正确的方向吗?

Car*_*and 17

require 'fileutils'

FileUtils.compare_file('file1','file2')
Run Code Online (Sandbox Code Playgroud)

返回true当且仅当文件file1file2是相同的.