Cra*_*ker 22 ruby file-comparison ruby-1.9
在Ruby 1.8中,我将从"ftools"库中调用File.compare()来轻松比较两个文件的内容.
但是,在Ruby 1.9中,"ftools"被"fileutils"取代,后者没有"比较"方法.什么是等效电话?
小智 15
老问题,但我刚从谷歌来到这里.identical?
适合那些喜欢我喜欢编码风格的人.
FileUtils.identical?(exp, act)
Run Code Online (Sandbox Code Playgroud)