Sha256: 5fed049d179e003e301a4ded52c4f8a2ee9c7367b58d1e6d484eb84fface5b87

Contents?: true

Size: 645 Bytes

Versions: 1

Compression:

Stored size: 645 Bytes

Contents

require 'digest/md5'
require 'ruby-wmi'

class DriveInfo

 def self.md5sum_disk(dir)
  digest = Digest::MD5.new()
  files  = Dir[dir + "VIDEO_TS/*.IFO"]
  files.sort.each{|f|
    digest << File.binread(f) 
  }
  raise 'bad drive' unless files.length > 0
  digest.hexdigest
 end

 def self.get_dvd_drives_as_win32ole
   disks = WMI::Win32_LogicalDisk.find(:all)
   disks.select{|d| d.Description =~ /CD-ROM/} # hope this works...
 end
  
def self.get_drive_with_most_space_with_slash
  disks = WMI::Win32_LogicalDisk.find(:all)
  most_space = disks.sort_by{|d| d.FreeSpace.to_i}[-1]
  most_space.Name + "\\"
end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sensible-cinema-0.16.3 lib/drive_info.rb