From: Ilmari Heikkinen Date: 2005-01-13T06:12:34+09:00 Subject: Re: Comparing two files for equality Hello, On 12.1.2005, at 21:56, georgesawyer wrote: > I came up with this: > > [snip] could also be written as (not thread-safe): def <=> f result = size <=> f.size ( result = read(SIZE) <=> f.read(SIZE) ) until result != 0 or eof? result end def IO.compare_file(fn1, fn2) open(fn1){|f1| open(fn2){|f2| f1<=> f2 }} end would be quite thread-safe maybe i'm worrying too much... one other solution: FileUtils.compare_file(fn1, fn2) cheers