Project

General

Profile

Feature #5337 ยป patch.diff

Glass_saga (Masaki Matsushita), 09/19/2011 06:01 PM

View differences:

lib/fileutils.rb
#
def compare_stream(a, b)
bsize = fu_stream_blksize(a, b)
sa = sb = nil
while sa == sb
sa = a.read(bsize)
sb = b.read(bsize)
unless sa and sb
if sa.nil? and sb.nil?
return true
end
end
end
sa = ""
sb = ""
begin
a.read(bsize, sa)
b.read(bsize, sb)
return true if sa.empty? && sb.empty?
end while sa == sb
false
end
module_function :compare_stream
    (1-1/1)