Class: NTFS::VolumeInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/fs/ntfs/attrib_volume_information.rb

Constant Summary collapse

VF_IS_DIRTY =
0x0001
VF_RESIZE_LOG_FILE =
0x0002
VF_UPGRADE_ON_MOUNT =
0x0004
VF_MOUNTED_ON_NT4 =
0x0008
VF_DELETE_USN_UNDERWAY =
0x0010
VF_REPAIR_OBJECT_ID =
0x0020
VF_CHKDSK_UNDERWAY =
0x4000
VF_MODIFIED_BY_CHKDSK =
0x8000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buf) ⇒ VolumeInformation

Returns a new instance of VolumeInformation.



31
32
33
34
35
36
37
38
39
# File 'lib/fs/ntfs/attrib_volume_information.rb', line 31

def initialize(buf)
  raise "MIQ(NTFS::VolumeInformation.initialize) Nil buffer" if buf.nil?
  buf      = buf.read(buf.length) if buf.kind_of?(DataRun)
  @avi     = ATTRIB_VOLUME_INFORMATION.decode(buf)

  # Get accessor data.
  @version = @avi['ver_major'].to_s + "." + @avi['ver_minor'].to_s
  @flags   = @avi['flags']
end

Instance Attribute Details

#flagsObject (readonly)

Returns the value of attribute flags.



20
21
22
# File 'lib/fs/ntfs/attrib_volume_information.rb', line 20

def flags
  @flags
end

#versionObject (readonly)

Returns the value of attribute version.



20
21
22
# File 'lib/fs/ntfs/attrib_volume_information.rb', line 20

def version
  @version
end

Instance Method Details

#dumpObject



45
46
47
48
49
50
51
# File 'lib/fs/ntfs/attrib_volume_information.rb', line 45

def dump
  out = "\#<#{self.class}:0x#{'%08x' % object_id}>\n"
  out << "  Major ver: #{@avi['ver_major'].to_i}\n"
  out << "  Minor ver: #{@avi['ver_minor'].to_i}\n"
  out << "  Flags    : 0x#{'%04x' % @flags}\n"
  out << "---\n"
end

#to_sObject



41
42
43
# File 'lib/fs/ntfs/attrib_volume_information.rb', line 41

def to_s
  @version
end