End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
FileUtils#compare_stream
compare_stream(a, b)
lib/fileutils.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/fileutils.rb, line 827
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
sa = String.new(capacity: bsize)
sb = String.new(capacity: bsize)
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.