Commons IO
  1. Commons IO
  2. IO-187

FileSystemUtils.freeSpaceKb doesn't work with relative paths on Linux

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2, 1.3, 1.3.1, 1.3.2, 1.4
    • Fix Version/s: 2.0
    • Component/s: Utilities
    • Labels:
      None
    • Environment:

      Linux

      Description

      Calling FileSystemUtils.freeSpaceKb with ".", "./", "../", "../foo" etc. will result in an empty string being passed to df.
      freeSpaceKb calls FileNameUtils.normalize on the path which destroys relative paths.

      I don't see any need to normalize the path so the fix is simply to remove that call.

        Activity

        Sebb made changes -
        Fix Version/s 2.0 [ 12312961 ]
        Mark Thomas made changes -
        Workflow jira [ 12448514 ] Default workflow, editable Closed status [ 12601826 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Sebb made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Sebb added a comment -

        Agreed - the path normalisation is unnecessary on Unix.
        [It's probably unnecessary on Windows as well]

        URL: http://svn.apache.org/viewvc?rev=919687&view=rev
        Log:
        IO-187 FileSystemUtils.freeSpaceKb doesn't work with relative paths on Linux

        Show
        Sebb added a comment - Agreed - the path normalisation is unnecessary on Unix. [It's probably unnecessary on Windows as well] URL: http://svn.apache.org/viewvc?rev=919687&view=rev Log: IO-187 FileSystemUtils.freeSpaceKb doesn't work with relative paths on Linux
        Sebb made changes -
        Field Original Value New Value
        Summary FileSystemUtils.freeSpaceKb doesn't work with relative paths FileSystemUtils.freeSpaceKb doesn't work with relative paths on Linux
        Cormac Blackwell created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Cormac Blackwell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development