gpt4 book ai didi

ruby - 我如何在 Ruby 1.9 中比较两个文件?

转载 作者:数据小太阳 更新时间:2023-10-29 06:29:38 25 4
gpt4 key购买 nike

在 Ruby 1.8 中,我会调用 File.compare()从“ftools”库轻松比较两个文件的内容。

但是,在 Ruby 1.9 中,“ftools”被“fileutils”取代,后者没有“compare”方法。什么是等效调用?

最佳答案

啊,该方法已重命名为 compare_file在 FileUtils 中。

两个版本中还有一个别名“cmp”。

关于ruby - 我如何在 Ruby 1.9 中比较两个文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8250380/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com