Sha256: 34016f626d91d8f81901ea7de20d0a7aa4454f0c4c0938c89b75fc6e4d07fd53
Contents?: true
Size: 914 Bytes
Versions: 14
Compression:
Stored size: 914 Bytes
Contents
module Fat32Probe def self.probe(dobj) $log.debug("Fat32Probe >> dobj=#{dobj}") if $log unless dobj.kind_of?(MiqDisk) $log.debug "Fat32Probe << FALSE because Disk Object class is not MiqDisk, but is '#{dobj.class}'" if $log return false end # Assume FAT32 - read boot sector. dobj.seek(0) bs = dobj.read(512) # Check byte 66 for 0x29 (extended signature). if bs[66] != 0x29 $log.debug("Fat32Probe << FALSE because there is no extended signature") if $log return false end # Check file system label for 'FAT32 ' # NOTE: This works for MS tools but maybe not for others. fslabel = bs[82, 8].unpack('a8')[0].strip fat32 = fslabel == 'FAT32' if $log $log.debug("Fat32Probe << TRUE") if fat32 $log.debug("Fat32Probe << FALSE because FS label is NOT FAT32, but is '#{fslabel}'") unless fat32 end fat32 end end
Version data entries
14 entries across 14 versions & 1 rubygems