9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/device/library/cygwin.rb', line 9
def get_device_root_dir(volume_name)
mount_root = `mount -p`.split("\n").last.split(/\s+/).first
Dir.glob("#{mount_root}/*") do |drive_path|
drive = drive_path.sub(/.*\//,"")
cmd = "cmd /c vol #{drive}:".encode(Encoding::Windows_31J)
capture = `#{cmd}`.force_encoding(Encoding::Windows_31J).encode(Encoding::UTF_8)
if capture.split("\n").first.match(/#{volume_name}/i)
return drive_path
end
end
nil
end
|