End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
FileUtils.compare_stream
compare_stream(a, b)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/fileutils.rb, line 837
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
if RUBY_VERSION > "2.4"
sa = String.new(capacity: bsize)
sb = String.new(capacity: bsize)
else
sa = String.new
sb = String.new
end
begin
a.read(bsize, sa)
b.read(bsize, sb)
return true if sa.empty? && sb.empty?
end while sa == sb
false
end
Returns true if the contents of a stream a and b are identical.