rtilley wrote: > I'm calculating md5 checksums on very large files (2 GB). This is a safe > way to do so, right? Also... is the file closed when the block exits? > I'm using 'rb' as this is used on Windows and Linux computers. > > md5 = Digest::MD5.new() > File.open(file, 'rb').each {|line| md5.update(line)} > Close.. try this.. require 'md5' File.open(filename,'rb') { |f| MD5.hexdigest(f.read) } And yes, the file is closed with the block form of open. --Steve