Method: DriveInfo.md5sum_disk

Defined in:
lib/simple_gui_creator/drive_info.rb

.md5sum_disk(dir) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/simple_gui_creator/drive_info.rb', line 25

def self.md5sum_disk(dir)
 if OS.mac?
   exe = "#{__DIR__}/../../vendor/mac_dvdid/bin/dvdid"
 else
   exe = "#{__DIR__}/../../vendor/dvdid.exe"
 end
 raise exe + '--exe doesnt exist?' unless File.exist? exe
 command = "#{exe} \"#{dir}\""
 output = `#{command}` # can take like 2.2s to spin up the disk...
 raise 'dvdid command failed?' + command unless $?.exitstatus == 0
 output.strip
end