Method: Xccleanup.get_byte_size

Defined in:
lib/xccleanup.rb

.get_byte_size(file_or_dir) ⇒ Object



49
50
51
52
53
54
55
56
57
# File 'lib/xccleanup.rb', line 49

def self.get_byte_size(file_or_dir)
	file_or_dir = file_or_dir
	if File.file? file_or_dir
		return File.stat(file_or_dir).size
	else
		cmd = "du -ks '#{file_or_dir}'"
		return (`#{cmd}`).split("\t").first.to_i * 1024
	end
end