Module: Windows::Volume
- Defined in:
- lib/windows/volume.rb
Constant Summary collapse
- DRIVE_UNKNOWN =
0
- DRIVE_NO_ROOT_DIR =
1
- DRIVE_REMOVABLE =
2
- DRIVE_FIXED =
3
- DRIVE_REMOTE =
4
- DRIVE_CDROM =
5
- DRIVE_RAMDISK =
6
Instance Method Summary collapse
-
#get_volume_type(vol = nil) ⇒ Object
Returns the volume type for
vol
or the volume of the current process if no volume is specified.
Instance Method Details
#get_volume_type(vol = nil) ⇒ Object
Returns the volume type for vol
or the volume of the current process if no volume is specified.
Returns nil if the function fails for any reason.
53 54 55 56 57 |
# File 'lib/windows/volume.rb', line 53 def get_volume_type(vol = nil) buf = 0.chr * 256 bool = GetVolumeInformation(vol, nil, nil, nil, nil, nil, buf, buf.size) bool ? buf.strip : nil end |