Details
Description
The method FileSystemUtils.freeSpace does not work on Sun Solaris.
[junit] Testcase: testGetFreeSpace_String took 0.216 sec
[junit] Caused an ERROR
[junit] Command line 'df' did not return info as expected for path '/'- response on first line was '/ (/dev/dsk/c0t0d0s0 ):41676304 block 3133314 filer'
[junit] java.io.IOException: Command line 'df' did not return info as expected for path '/'- response on first line was '/ (/dev/dsk/c0t0d0s0 ):41676304 block 3133314 filer'
[junit] at org.apache.commons.io.FileSystemUtils.freeSpaceUnix(FileSystemUtils.java:315)
[junit] at org.apache.commons.io.FileSystemUtils.freeSpaceOS(FileSystemUtils.java:179)
[junit] at org.apache.commons.io.FileSystemUtils.freeSpace(FileSystemUtils.java:126)
[junit] at org.apache.commons.io.FileSystemUtilsTestCase.testGetFreeSpace_String(FileSystemUtilsTestCase.java:90)
This is because on Solaris the df command work different if the flag -k is used or not:
$ df /
/ (/dev/dsk/c0t1d0s0 ): 1070402 blocks 294205 files
$ df -k /
Filesystem kbytes used avail capacity Mounted on
/dev/dsk/c0t1d0s0 1350955 815754 481163 63% /
I haven't found any flag that makes it output GNU format even when -k is omitted.