Class: NTFS::VolumeInformation
- Inherits:
-
Object
- Object
- NTFS::VolumeInformation
- 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
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(buf) ⇒ VolumeInformation
constructor
A new instance of VolumeInformation.
- #to_s ⇒ Object
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
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
20 21 22 |
# File 'lib/fs/ntfs/attrib_volume_information.rb', line 20 def flags @flags end |
#version ⇒ Object (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
#dump ⇒ Object
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_s ⇒ Object
41 42 43 |
# File 'lib/fs/ntfs/attrib_volume_information.rb', line 41 def to_s @version end |