Ah. Well, that is not the code in version 1.51. I see that commit 275754a which added the FreeBSD part wasn't made until a year after 1.51 was released. Maybe it's time for a new release?
If I backport that commit to 1.51, it makes no difference, because it's looking for a preprocessor define __FreeBSD__, which is not defined on macOS. If I change it to #elif defined(__FreeBSD__) || defined(__APPLE__), then the program works, to the extent that the main window appears, and I can choose a volume and get more information. However, the information in both windows does not match the information shown in the screenshots on your web site, so I don't think the correct information is being extracted from the output of the df and du commands. Note that more recent versions of macOS have more columns in their df output than earlier macOS versions did. I'm doing my tests on macOS High Sierra 10.13.6 at the moment.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure when legacy mode comes into effect but in case there are some situations where it does, it seems prudent to put the -P flag before the existing -k flag.
So this is the patch I'm now using in MacPorts with xdiskusage 1.51
(in addition to 275754a).
It is possible that the -P flag should also be added when running df on other operating systems in case they also adopt SUSv3. I don't know if any of them do or will.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you find out why this code at the start of xdiskusage.C does not cause the command to be the
"df -k -t noprocfs,devfs,fdescfs"
string?Ah. Well, that is not the code in version 1.51. I see that commit 275754a which added the FreeBSD part wasn't made until a year after 1.51 was released. Maybe it's time for a new release?
If I backport that commit to 1.51, it makes no difference, because it's looking for a preprocessor define
__FreeBSD__
, which is not defined on macOS. If I change it to#elif defined(__FreeBSD__) || defined(__APPLE__)
, then the program works, to the extent that the main window appears, and I can choose a volume and get more information. However, the information in both windows does not match the information shown in the screenshots on your web site, so I don't think the correct information is being extracted from the output of thedf
anddu
commands. Note that more recent versions of macOS have more columns in theirdf
output than earlier macOS versions did. I'm doing my tests on macOS High Sierra 10.13.6 at the moment.For example, this output is from Mac OS X 10.5:
And this output is from macOS 10.14:
man df
(on macOS 10.13 High Sierra) explains why the output is now different:So we just need to add
-P
to thedf
flags to suppress it. But its description is:And in the legacy section of the manual it says:
I'm not sure when legacy mode comes into effect but in case there are some situations where it does, it seems prudent to put the
-P
flag before the existing-k
flag.So this is the patch I'm now using in MacPorts with xdiskusage 1.51
(in addition to 275754a).
It is possible that the
-P
flag should also be added when runningdf
on other operating systems in case they also adopt SUSv3. I don't know if any of them do or will.I put the -P in as suggested, but it might be better to fix the parser to skip the extra columns.
Actually it has to count from the last column because the first one (the filesystem) can have spaces in it. So probably this is the best solution.