view bin/cek.rb @ 62:996aa2f81721

[bash] various fixes: - export the path first thing - also add export on sunos case. - alias early - unused _has_bsd_ls - added openbsd, check for colorls which is an awesome command
author Edho Prima Arief <me@myconan.net>
date Fri, 06 May 2011 03:15:24 +0700
parents 94ee419ad047
children 72c299437fde
line wrap: on
line source

#!/usr/bin/env ruby
require 'zlib'

block = 1048576
ARGV.each do |filename|
	crc = 0
	file = File.open(filename, 'rb')
	currentbyte = 0
	while (line = file.read(block)) do
		crc = Zlib.crc32(line,crc)
	end
	file.close
	printf("%s %08X\n", filename, crc.to_s)
end