From: MikkelFJ Date: 2002-12-22T22:09:34+09:00 Subject: Re: Quickest way to get md5 of a file? "Yukihiro Matsumoto" wrote in message news:1040550973.608293.14507.nullmailer@picachu.netlab.jp... > |Is there some trick to speed this up or should we consider adding > |a checksum_of_file method to Digest? > > ruby -r digest/md5 -e 'ARGV.each{|f|print f, " "; puts Digest::MD5.hexdigest(File.read(f))}' * This doesn't work on Windows 2K, Ruby 1.6.7 or 1.7.3-7 It says that 'f' is not a valid file. File.read(f) doesn't work on 1.6.7 (use File.new(f).read but it does work on 1.7.3-7) require 'digest/md5' v = ['test.rb'] v.each{|f|print f, " "; puts Digest::MD5.hexdigest(File.new(f).read)} Mikkel