Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-91

FileSystemUtils.freeSpace does not work on Sun Solaris

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2
    • 1.3
    • Utilities
    • None
    • SunOS et 5.10 Generic_118822-25 sun4u sparc SUNW,Ultra-4
      SunOS alien 5.8 Generic_111433-02 sun4u sparc SUNW,Ultra-4

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            grimsell Magnus Grimsell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: