Read df output in binary mode

Fixes Homebrew/homebrew#30046.
This commit is contained in:
Jack Nagel 2014-06-11 00:42:50 -05:00
parent 5ec52ea4da
commit c0e0bd2984

View File

@ -25,7 +25,7 @@ class Volumes
def get_mounts path=nil def get_mounts path=nil
vols = [] vols = []
# get the volume of path, if path is nil returns all volumes # get the volume of path, if path is nil returns all volumes
raw_df = `/bin/df -P #{path}` raw_df = IO.popen("/bin/df -P #{path}", "rb", &:read)
raw_df.split("\n").each do |line| raw_df.split("\n").each do |line|
case line case line
# regex matches: /dev/disk0s2 489562928 440803616 48247312 91% / # regex matches: /dev/disk0s2 489562928 440803616 48247312 91% /