04
May
09

get md5 signatures for all files inside a folder



I wrote this script because I needed to get the signatures of all the files inside a directory.The search’s recursive, so, you’ll get’em all.

require "find"
require "digest/md5"

dir 	= ARGV[0]

Find.find(dir) do |file|
	next if File.directory? file
	digest = Digest::MD5.hexdigest(File.read(file))
	puts file
	puts digest
	puts
end

Advertisements

0 Responses to “get md5 signatures for all files inside a folder”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 223,857 hits

%d bloggers like this: